After .pause(), .play() does NOT resume from the paused position but from an earlier point
See original GitHub issueConcerns: https://p5js.org/reference/#/p5.SoundFile/pause OS: Windows 7 Browser: Firefox Quantum 57.02 (64 bits) p5.js v0.5.16
let bPlay = true;
let sndFile;
function preload()
{
sndFile = loadSound('Sound/D960_3.mp3');
}
function setup()
{
sndFile.play();
}
function mousePressed()
{
if (bPlay) { sndFile.pause(); bPlay=false; }
else { sndFile.play(); bPlay=true; }
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
AVPlayer can't resume after paused + some waiting
play() ok it continues but if I wait 30-60 sec after .pause() and try to .play() it sometimes fail to play,. AVPlayerStatus.Failed returns...
Read more >526411 - after pausing a video it often won't restart playing later
When the video is stuck, I can issue .load() and it successfully restarts ... local files will still not play again after pressing...
Read more >Pausing and Resuming an Activity | Android Developers
As your activity enters the paused state, the system calls the onPause() method on your Activity , which allows you to stop ongoing...
Read more >IMediaControl::Run method (control.h) - Win32 - Microsoft Learn
Therefore, if you run the graph, pause it, and then run it again, playback resumes from the paused position. If you run the...
Read more >Play, from paused, jumps to the start for no reason
This happens to me frequently; imagine I'm working my way through an audio document, I pause the playback for some reason, if I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
change the
let pause = false
value totrue
. removemusic.play();
insetup()
function, if you want to control using mousePressed.full code:
btw, have you tried using Google Chrome?
No need to thank me @BS-007 ":]