help - FormatConversion not working with stream #785
-
Hello, I am doing a project where I have an ESP32 reciving I2S commuincation and sends that exact data to two I2S outputs but one of outputs would be delayed by a controllable amount (I want to sync my the audio between my TV and speakers). So I am trying to takle the problems in sequence. While I was testing the delay effect, I think it can only work well on sample rate 44100 and 1 channel (mentioned in one of the disscusions). So I want to make sure I can get a working delay effect on only one of the outputs. But to test that I need a source I can test with that has 44100 sample rate. I am trying to use the stream mp3 example sketch, but I am not able to convert the output to sample rate 44100. The mp3 URL always forces the I2s to sample rate 44100.
Sketch Code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
MP3 contains the sample rate, so the EncodedAudioStream automatically sets the audio information provided by the mp3. I also suggest to start simple and add complexity step, by step. That's how you will find where you made your error! You can also try just to use the sample rate and i2s buffer to control the delay: the smaller the rate the bigger the delay and the bigger the buffer the bigger the delay. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
MP3 contains the sample rate, so the EncodedAudioStream automatically sets the audio information provided by the mp3.
I don't understand why you add this complexity when you plan to get the data from i2s in the end.
For testing just keep things simple and use a sine generator (or just use an mp3 file recorded in your desired sample rate!)
I also suggest to start simple and add complexity step, by step. That's how you will find where you made your error!
You can also try just to use the sample rate and i2s buffer to control the delay: the smaller the rate the bigger the delay and the bigger the buffer the bigger the delay.