Closed Explorerlowi closed 1 month ago
There is audio.pauseResume();
for this
I'm playing the music above. Then I executed the pause instruction and called audio.pauseResume(); but the music was still playing and did not pause.
I'm playing the music above. Then I executed the pause instruction and called audio.pauseResume(); but the music was still playing and did not pause.
When I use audio2.stopSong();, it can stop the music playing, but I don't know how to resume playing from the paused position
perhaps the command is called several times?
if(audio.isRunning()) audio.pauseResume();
I found the reason. When audio.loop() is executed, the m_streamType = ST_WEBSTREAM; set when playing music will be changed to m_streamType = ST_WEBFILE;. As a result, when audio.pauseResume() is called, the judgment of if (getDatamode() == AUDIO_LOCALFILE || m_streamType == ST_WEBSTREAM) does not hold, so the playback cannot be paused and resumed.
I found the reason. When audio.loop() is executed, the m_streamType = ST_WEBSTREAM; set when playing music will be changed to m_streamType = ST_WEBFILE;. As a result, when audio.pauseResume() is called, the judgment of if (getDatamode() == AUDIO_LOCALFILE || m_streamType == ST_WEBSTREAM) does not hold, so the playback cannot be paused and resumed.
Change the conditional judgment to if (getDatamode() == AUDIO_LOCALFILE || m_streamType == ST_WEBFILE) to pause and resume playback normally.
PauseResume only works with local files. This is not always successful with web files. The server could disconnect if a timeout occurs.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
How do I pause the music that is playing? After pausing, can I resume the music from where I paused it? If so, how do I do it?