jump() on a paused sound throws error

Open Beginner friendly
#132 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
backend

Research direction

Start by locating the jump() implementation and its tests, then trace how paused playback rate affects the end-time calculation. Reproduce the error with the linked p5.js sketch. Done when calling jump() on a paused sound no longer throws and behaves as intended for the playhead.

Written by the indexing model from the issue text.

Description

jump() on a paused sound throws error "RangeError: Value must be within [0, Infinity], got: NaN"

The error may be “Invalid argument to cancelAndHoldAtTime: null”. A paused sound is really playing at rate 0, so the end-time calculation divides by zero and gives null?

Either guard against rate 0 or make jump() just move the playhead while paused.

https://editor.p5js.org/steinster/sketches/7QF4WHLeU

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.