Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving the generated audio for WAV or MP3 #20

Open
carlosguedes opened this issue May 7, 2018 · 5 comments · May be fixed by #41
Open

Saving the generated audio for WAV or MP3 #20

carlosguedes opened this issue May 7, 2018 · 5 comments · May be fixed by #41

Comments

@carlosguedes
Copy link

Dear Brian, it's me again, needing your assistance. I would like to generate the sound and be able to export it to wav or any other format with the JS version.

Can you give me directions on how to do it?

Thank you very much as always!

@brian-armstrong
Copy link
Member

Hi @carlosguedes,

The JS lib doesn't have that functionality. I didn't think it'd be particularly useful.

You could fork it to get the raw samples relatively easily, but then you would still need to put them in the WAV container. The C library uses libsndfile to do that, which won't be present here.

If you want to try, the first step would be to add a new function that wrap quiet_encoder_emit. It's already called by the webaudio callbacks in JS, so you could just find those and copy/paste into a new function that returns the samples. You'd also have to add some way to disable the webaudio bits so that you could invoke consume directly.

Let me know if you have more questions.

@trghauri
Copy link

Dear Brain, first of all thanks for great api.
can you please share the code for generating audio ?

@yaroslav-perec
Copy link

Hi @brian-armstrong,

I'm trying to get raw samples, could you please tell me if this function returns them?

var written = Module.ccall('quiet_encoder_emit', 'number', ['pointer', 'pointer', 'number'], [encoder, samples, sampleBufferSize]);

@yaroslav-perec
Copy link

Hi @carlosguedes,

Have you managed to set it up somehow?

otanim added a commit to otanim/quiet-js that referenced this issue Jul 1, 2021
@otanim
Copy link

otanim commented Jul 1, 2021

@brian-armstrong, may I ask your attention here, I've created a PR for this issue that allows downloading transmissions in ".wav" format:
#41

@carlosguedes, @trghauri, @yaroslav-perec FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants