How to play a beep during MP3 playback?
Posted: Mon Feb 24, 2020 2:36 am
Our application needs to play a short beep as audio feedback when certain buttons are pressed. This needs to happen while an MP3 track is playing but it is okay if the mp3 track stops for the duration of the beep..
I've tried having two pipelines set up, pausing one, and playing the other then swapping back. This causes problems because the two i2s stream writers conflict.
I found the Downmix component but my beep track is a fixed 16000 samples per second and the MP3 tracks can be anything. I suppose I could install the Resample filter on the beep pipeline so the sample rates can match but this is starting to seem like overkill.
Is there a way to simply pause the MP3 pipeline and "unhook" the i2s writer element from the driver? I could then play the beep, reconnect the mp3 pipeline's i2s stream writer and resume the pipeline.
Can anyone offer any advice on this? I expect it is quite a common issue as many music players offer audio feedback.
I've tried having two pipelines set up, pausing one, and playing the other then swapping back. This causes problems because the two i2s stream writers conflict.
I found the Downmix component but my beep track is a fixed 16000 samples per second and the MP3 tracks can be anything. I suppose I could install the Resample filter on the beep pipeline so the sample rates can match but this is starting to seem like overkill.
Is there a way to simply pause the MP3 pipeline and "unhook" the i2s writer element from the driver? I could then play the beep, reconnect the mp3 pipeline's i2s stream writer and resume the pipeline.
Can anyone offer any advice on this? I expect it is quite a common issue as many music players offer audio feedback.