Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
How can you detect wether any music is playing in Phaser?

In my game, I want to play music sometimes. But music that is already playing shouldn’t be overridden.

So how can I

  1. Check if music is playing
  2. Manage that sound

Ideally in an global interface like this.sound

Thanks in advance

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

HTML5AudioSound has isPlaying member.

// inside scene method, create sound
const music = this.sound.add('music-name', {});
music.play();

// and later
if(music.isPlaying) {

}

See https://newdocs.phaser.io/docs/3.54.0/Phaser.Sound.HTML5AudioSound#isPlaying and https://newdocs.phaser.io/docs/3.52.0/Phaser.Sound.HTML5AudioSoundManager

(this.sound is HTML5AudioSoundManager instance)

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!