ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

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

Open bhpjean opened this issue 1 year ago • 1 comments

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

bhpjean avatar Jun 18 '24 13:06 bhpjean

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.

schreibfaul1 avatar Jun 20 '24 20:06 schreibfaul1

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

github-actions[bot] avatar Jul 21 '24 02:07 github-actions[bot]

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

github-actions[bot] avatar Aug 04 '24 02:08 github-actions[bot]