How to control the volume of AudioSourceSPIFFS
and AudioSourceURL
?
#1714
-
I'm trying to make the volume working with For SPIFFS I have followed the example (https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-player/player-spiffs-i2s/player-spiffs-i2s.ino) but the audioPlayer.setVolume() does nothing, I tried with multiple value (like 0.5f, 0.1f, 0.01f) nothing change. I have the same result with the The output is the I2SStream to an external DAC. Does somebody have any idea on how I can make this work ? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
I never had any issues with this and there were not changes recently which could cause any such issues. |
Beta Was this translation helpful? Give feedback.
-
Just made a test and I could not reproduce your issue:
both when called before or after player.begin(). if you look at your library.properties what version number do you see ? Here are the relevant log entries for the volume of 0.1
|
Beta Was this translation helpful? Give feedback.
-
Just set the log level to Info |
Beta Was this translation helpful? Give feedback.
-
Ok, here is my understanding: you also need to add the following decoder.addNotifyAudioChange(player); So that the player is notifed about the format by the decoder. This is with the current logic also setting up the VolumeStream volume_out. I committed a correction that is calling begin() on the volume_out which should make the issue go away as well. But without notification you run the risk that the sample rate, channels and bits per sample are not matching with the actual played back audio |
Beta Was this translation helpful? Give feedback.
-
What ESP32 core version are you using ? On my first thought there might be an issue with the Wifi or internet connection: Did you try to bring the ESP32 closer to the router or try another radio station that is in your country ? You can try to adjust the timeout parameters in the AudioSource ... |
Beta Was this translation helpful? Give feedback.
-
Try to find out if the issue is caused by the decoder or by the WiFi! |
Beta Was this translation helpful? Give feedback.
Just made a test and I could not reproduce your issue:
both when called before or after player.begin().
if you look at your library.properties what version number do you see ?
Do you have maybe an i2s module with a dynamic volume control which would automatically amplify a lower input ?
Here are the relevant log entries for the volume of 0.1