After .pause(), .play() does NOT resume from the paused position but from an earlier point

edited December 2017 in p5.js Library Questions

Concerns: 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;  }
}

Answers

Sign In or Register to comment.