Skip to content

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

Closed

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.

Activity

  1. changed the title [-]soundFile.jump(0) not working properly when called at too short intervals[/-] [+]soundFile.jump(0) starts a new instance of the sound, instead of restarting the sound.[/+] on Aug 17, 2019
  2. kevinstadler commented on Aug 18, 2019

    @kevinstadler
    Collaborator

    Thanks for reporting, I think this issue should already be resolved with the upcoming version of the Sound library. Could you do me a favour and try installing the following library test build to see if it fixes your issue? https://github.com/processing/processing-sound/releases/download/v2.2.3/sound.zip
    Just extract the zip file into your Processing/libraries/ folder, replacing the content of the existing sound/ folder. Please let me know if you run into any troubles, or if the update doesn't fix your issue.

  3. added
    bug
    on Aug 18, 2019
  4. liasomething commented on Aug 18, 2019

    @liasomething
    Author

    hi kevin,
    yes, it's fixed with this version, thanks!!!
    :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions