play() stays silent after pause() then stop()

Open Beginner friendly
#131 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Find the stop() implementation and check how it updates the same song state that pause() changes. Reset paused in stop() so a later play() starts the sound. Confirm the behavior with the linked p5.js sketch: pause, stop, then play should produce audio.

Written by the indexing model from the issue text.

Description

pause() sets song.paused = true, and stop() never sets it back to false. The next play() thinks the sound is paused and silently does nothing.

The fix is to reset paused inside stop().

I know it is probably unlikely that someone will pause() then stop() but if they do, play() will not start the sound.

https://editor.p5js.org/steinster/sketches/W7KBbFvAf

Dominant language
JavaScript
Stars
60
Forks
28
Avg merge
8h 53m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from processing/p5.sound.js

All issues in processing/p5.sound.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.