In the application I am developing we are recording live from the mic and playing back the record buffer simultaneously (similar to the recording sample).
In some acoustic environments we are getting strong howling feedback. Of course when I point the mic directly into the speakers this occurs but in some environments we have seen it happen when the mic does not appear to be physically directed at a speaker.
Is there anything that can be done about this in software?
- Guile0 asked 9 years ago
Thanks. Can you give a quick, high-level list of what would be needed to be done in FMOD to apply something like this in realtime? Assuming that the echo cancellation algorithm exists.
Retrieve spectrum from record buffer via method X.
Write results back into record buffer via method Y.
Any help is appreciated.
If you were doing continuous recording (looping) like the recording example, you would need to lock the record sound to get the sound data out and apply the algorithm.
So you could operate in a double buffered manner by starting the record, wait until half of the record sound has been recorded into, then use Sound::lock to lock that first half, copy out the data, filter it, then copy that data into another sound, then unlock the record sound. Next you lock the second half of the file once it has finished being recorded to (and so on…). You can use System::getRecordPosition to find out where in the sound it’s currently recording to.
We are doing continuous looping recording for the purpose of making a live mic where recorded sound is played back out the speakers. So with the double buffer system I assume that means you would be stuck with a (buffer size / 2) amount of latency as a minimum then from the time the audio is recorded til the time is played back.
A goal in our application is to minimize the amount of latency from when sound is recorded to when it is output. If this was implemented as a custom DSP would there be a way to reduce the latency?
Yes, if low latency is super crucial to your application then a custom DSP will allow you to directly inject data into the DSP chain for output.
The same principals apply except you need to satisfy the number of samples asked for by the custom DSP callback.
So you would start filling your record sound as soon as possible, then in your custom DSP you would return silence for a short amount of time (this will be your fixed latency), enough time to get one block of data into the record sound so you can lock it, get the data out, process it and return it to the callback.
Please login first to submit.