Skip to content

Commit 96d4788

Browse files
committed
I2SCodecStream correct startup volume logic
1 parent 4d62a38 commit 96d4788

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/AudioTools/AudioLibs/I2SCodecStream.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ class I2SCodecStream : public AudioStream, public VolumeSupport {
214214
is_active = i2s.begin(cfg);
215215

216216
// if setvolume was called before begin
217-
if (is_active && volume() >= 0.0f) {
218-
setVolume(volume());
217+
float tobeVol = VolumeSupport::volume();
218+
if (is_active && tobeVol >= 0.0f) {
219+
setVolume(tobeVol);
219220
}
220221
return is_active;
221222
}

0 commit comments

Comments
 (0)