Home Forums Sparkfun MP3 Shield Library Support Forum Changing Volume while paused. Reply To: Changing Volume while paused.

#1837

I have been out of town.

Yes, the restart from volume became obvious from another thread. A pre-release version has that fixed. This version’s example works. But has some new features and different file handling that I am still evaluating.

Also note there is no need to pause the music as to change the volume. There is a mechanism under the hood to avoid collision for that process.

Yes, I saw the pause was originally intended for quick SPI access. Where as I was not able to get the internal pause of the chip to work. Due to refill(). And this works reasonably. Note that stopTrack actually flushes the VS1053 buffer and pauseDataStream simply pause the refill.

In that pauseDataStream and playMP3 are coupled to the VS1053 buffer, the MP3Play makes an initial fill of the buffer, and the VS1053 will play that regardless. as the pauseDataStream  simply stops filling it. hence your initial blast.

The pre-release version may with its state fullness may handle this better. But may need tweak to the skip for it to work better.

Where your above examples issue is not in the pause but the fact that the playMP3 makes the initial fill of the buffer.

I am not sure why

MP3player.pauseDataStream();
delay(5000);
MP3player.resumeDataStream();

does not do the job in place of your above snippet. where you could set the volume either before or after the pause. And in the pre-release in between.

An overload of resumeDataStream(uint32_t timecode) that does the skip to, may be the solution. Likewise a an overload of the playMP3(char* fileName, uint32_t timecode). Where as I note that uint32_t timecode is somewhat limited as to the maximum time it can skip to).