Changing data source sometimes alters pitch #2248
-
|
I have two streams in my internet radio - a URLStream and an HLSStream. When I change station I 'end()' the stream that is playing at the time, before the 'begin(url)' of the new station. Sometimes the new station will play audio at the proper speed but at a higher pitch. I think this is when going from an HLSStream to a URLStream, maybe because of a change in the sampling rate? I've tried adding addNotifyAudioChange(i2s) to both streams but it hasn't made any difference. What's the best way to fix this? Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I think I have solved this (please excuse my lack of knowledge!) by explicity getting the sample rate from the stream and setting it on i2s each time the station is changed. and The hls_stream sample rate is reported as being 44100 but I get a warning
So it seems that the sample rate was being changed to 48000 when using the hls_stream, and this then caused the pitch change when going back to the mp3 stream. |
Beta Was this translation helpful? Give feedback.
-
|
I think this works as described in the documentation! |
Beta Was this translation helpful? Give feedback.
I think this works as described in the documentation!