How to resample URLStreams to 48KHz before sending via I2S to Speaker? #1438
-
Hi folks! I'm trying to find out how to resample every URLStream that is not 48KHz. I bought a TSA5001 to transmit I2S data directly via Bluetooth. The TSA5001 supports only a fixed sampling rate of 48KHz. I'd like to add the TSA5001 to my own webradio project. TSA 5001 Specs:
Below is my code that does no resampling. The playback of a source sampled with 44,1KHz has the same 'interrupts' as if I'm trying without ResampleStream. There is a comment saying " // setup I2S based on sampling rate provided by decoder". But I don't understand how give this information from the decoder to the ResamplingStream instead of the i2s out. I haven't yet looked at Phil's player example. Can I find some information for my question there or anywhere in this huge audio-tools project? Thanks in advance for your support!
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Your code does not make any sense: You need to create an output chain! ps. the wiki describs the logic that has been implemented for the propagation of format changes, so my expectation is that you would not need to do anything here |
Beta Was this translation helpful? Give feedback.
-
Hm, the playback of a 44,1KHz stream is still not perfect. The pitch is to high. I see many helpful information (e.g. The
|
Beta Was this translation helpful? Give feedback.
I made another attempt using
ResampleStream
again (see code below). That works in general - the playback is perfect! Thank you for your food for thought!BUT:
URLStream
to get a clean playback. It's like the filter chain gets out of sync and then there is no resync anymore.Any idea on this?