0

I am using html5 web audio api in my application. Application is simple, I have

BufferSourceNode -> GainNode -> lowpass filter -> context.destination

Now I want to save the output after applying the filters. So I decided to add recorder before context.destination. But this doesn't work, it gives some noise sound while playing the audio, though my recorder records filter effects successfully.

Am I doing it in right way or is there any better way to do this?

0

1 Answer 1

1

Two things:

1) if you are going to use the buffer anyway - even if you're not() - you might want to consider using an OfflineAudioContext (https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OfflineAudioContext-section). OACs can run faster than real-time, so you don't need to "record" it in real-time; you set up your nodes, call startRendering(), and the oncomplete event hands you an audiobuffer. () If you still want a .WAV file, you can pull the WAV encoding function out of Recordjs and use it to encode an arbitrary buffer.

2) That sounds like an error in your code - it should work either way, without causing extra noise. Do you have a code sample you can send me?

Sign up to request clarification or add additional context in comments.

3 Comments

hi cwilso, here is how I implemented OAC gist.github.com/pramodtech/8347621 , I'm not sure if I did it right.. can u guide me on this? thanks.
You shouldn't need to use all of record.js to do the recording - OfflineAudioContext will do it for you. Call startRendering() first, after setting an oncomplete handler - THEN call all your start(0)s, etc. You'll receive an oncomplete event when it's finished, with a renderedBuffer - this is the results of your rendering. Take THAT and use the encoding from record.js to generate your .WAV file.
Should have mentioned - you CAN'T currently use record.js in offline contexts in Chrome, because we have a bug that prevents script processor nodes from working properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.