Author Topic: Sound not working  (Read 1232 times)

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Sound not working
« on: Wed, Jun 30, 2010 »
Code: [Select]
public class PlayState extends FlxState
   {
  [Embed(source='Sounds/boom.wav', mimeType='application/octet-stream')]
  private var soundBoom:Class;
  [Embed(source='Sounds/pewpew.wav', mimeType='application/octet-stream')]
  private var soundLazer:Class;
  [Embed(source='Sounds/splosion.wav', mimeType='application/octet-stream')]
  private var soundSplosion:Class;
//...

This is how I'm instantiating the sounds. All directories are correct and the output is not throwing any errors, yet the sounds are not playing when I call the sound variable ( via FlxG.play(sound) ).

Any suggestions?


Edit: I also just noticed that if I call the sound before all of the other statements in a function or if statement, none of the other statements run, but the state still continues.
« Last Edit: Wed, Jun 30, 2010 by NateTheGreatt »
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

luc

  • Member
  • **
  • Posts: 97
  • Karma: +0/-0
  • no ablo anything except french
    • View Profile
    • scribbles
Re: Sound not working
« Reply #1 on: Wed, Jun 30, 2010 »
Hi, you can't use .wav embedded for now, only .mp3
Or you can go this way using the flash API.

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: Sound not working
« Reply #2 on: Wed, Jun 30, 2010 »
Hi, you can't use .wav embedded for now, only .mp3
Or you can go this way using the flash API.

Ah okay. I wasn't aware of that >.>

Thanks!
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: Sound not working
« Reply #3 on: Wed, Jun 30, 2010 »
Hi, you can't use .wav embedded for now, only .mp3
Or you can go this way using the flash API.

Ah okay. I wasn't aware of that >.>

Also, that's a very useful link!

Thanks buddy
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery