Skip to content

[p5.js 2.0 Bug Report]: p5 sound loop() not working #8126

@megamitts

Description

@megamitts

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.5

Web browser and version

All

Operating system

All

Steps to reproduce this

Steps:

  1. Load a music file
  2. Set music to loop
  3. Nothing plays

Snippet:

// very pseudo!

let music;

music = await loadSound('music.mp3');

music.loop();

The tune will not play. It will work fine if you use music.play() instead and a workaround is to use music.onended() to create a function that just kicks in music.play() again but music.loop() just does nothing and doesn't even fire any errors in the console.

Am I doing something wrong when calling loop() in 2.0.x now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions