Skip to content

soundFile.jump(0) starts a new instance of the sound, instead of restarting the sound. #44

@liasomething

Description

@liasomething

to reproduce prepare an mp3 called sound.mp3, 10 seconds long. Use the following sketch:

import processing.sound.*;
SoundFile sound;

void setup() {
  sound = new SoundFile(this, "sound.mp3"); 
  sound.loop();
}

void draw() {
  background(255);
}

void mousePressed() {
  // sound.stop(); // does not help the problem
  sound.jump(0);
}

Run, wait until the sound starts to play. Click the mouse, observe what happens. Wait a few seconds and click the mouse again, observe what happens.

expected behaviour: with every mouse click, the sound restarts at the start of the song.
actual behaviour:

  • The first mouse click restarts the sound.
  • Subsequent mouse clicks trigger a new instance of the sound, while older instances continue to play.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions