quiet-js icon indicating copy to clipboard operation
quiet-js copied to clipboard

#20: Adding a functionality to download transmissions as .wav files.

Open otanim opened this issue 3 years ago • 1 comments

The goal is to allow record transmissions, this resolves #20 issue.

With the following changes now you can set the following 2 new parameters for the transmitter:

  • downloadTransmission - type: boolean, default: false, indicates if the generated sound needs to be downloaded after its transmission,
  • downloadableTransmissionFileName - type: string, default: "transmission.wav", set's downloadable file's name.

Example:

const transmit = Quiet.transmitter({
    profile: profilename,
    clampFrame: false,
    onFinish: onTransmitFinish,
    downloadableTransmissionFileName: 'transmission.wav',
    downloadTransmission: true,
});

otanim avatar Jul 01 '21 18:07 otanim

Hi @otanim

Thanks for the PR.

I'd like this functionality to make use of libsndfile, same as the C library does so that they generate the same file. The JS building pipeline (via emscripten) will need to bundle libsndfile and then the JS layer can call into it using similar logic as the C encode_file.c program. I'd be happy to give suggestions on this process if it helps.

Cheers Brian

brian-armstrong avatar Jul 01 '21 20:07 brian-armstrong