schreibfaul1 / ESP32-audioI2S

Play mp3 files from SD via I2S
GNU General Public License v3.0
1.06k stars 281 forks source link

audio.getBitRate() returns stale values ​​for VBR streams #772

Closed bhpjean closed 1 month ago

bhpjean commented 2 months ago

Welcome back ! you are doing a wonderful job.

I have this question.

  1. The older audio library (from 2022) was able to reconnect to the stream if it was lost. This doesn't work so well in newer libraries. I guess the reconnect function doesn't work at all in case of connection loss.

  2. What happened to the "audio.getBitRate()" function, older libraries showed the current bitrate for stations broadcasting VBR. The new ones only show the bitrate at the moment of connecting to the stream and this value is constant even though the stream is VBR

schreibfaul1 commented 2 months ago

Hello @bhpjean,

  1. in the event of a timeout when reading the HTTP response header, I have now added a reconnect. I'm not sure if that's what you mean, in the event that the stream breaks, an attempt is made to re-establish the connection, nothing has changed.
  2. that's right, the bit rate is the value that was determined first. This is, for example, the value supplied by the stream. With VBR (local file), this value can vary greatly. Analysing several samples of the file in advance would take too long. However, an average value is calculated at runtime, which approximates the actual bit rate after a few seconds, please use audio.getBitRate(true); for this purpose.
github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.