Tiny noise chirp between AudioPlayer stop and next function calls. #2284
-
|
If I call stop on an MP3 stream, followed by next(newidx), there is a tiny chirp at the start when the new index is activated. The chirp seems to be remnants of the previous audio stream. Using player.setAutoFade(false) fixes the problem but the auto fade is a nice feature to have. I tried player.writeSilence(2048) before calling next but that did not work. Is there another function that should be called before resuming a play? It's noticeable more so with headphones due to the reduction in ambient noise. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
An mp3 file is made of frames: each frame depends on the prior frames, so if you decide to drop data, you should reset the mp3 decoder first before you restart to use it: e.g. just call end() followed by begin()! In regular processing, the audio file starts with no sound and ends with fading out the audio data for quite some time. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Phil, I tried end and begin as suggested but chirp remained so I'll continue to use setAutoFade(false). |
Beta Was this translation helpful? Give feedback.
An mp3 file is made of frames: each frame depends on the prior frames, so if you decide to drop data, you should reset the mp3 decoder first before you restart to use it: e.g. just call end() followed by begin()!
In regular processing, the audio file starts with no sound and ends with fading out the audio data for quite some time.