Author Topic: Play 10 sounds  (Read 1271 times)

ljbeng

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Play 10 sounds
« on: June 01, 2015, 06:37:26 am »
I have Box2d and ContactListener working.  I have 10 objects on the screen.  I have an array of 10 sounds, one for each object.  When the objects collide, they need to play a sound.  Shouldn't the sound blend?   It seems each sound gets triggered and plays but stops the previous sound that started.  It's like I can only play one sound at a time.

ljbeng

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Play 10 sounds
« Reply #1 on: June 01, 2015, 01:05:44 pm »
I fixed it.  I was loading sound.snd 10 times and had to create 10 sound files sound1.snd, sound2.snd etc and load those separate files even though they are the same sound.

Micboy

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-2
    • View Profile
Re: Play 10 sounds
« Reply #2 on: June 01, 2015, 04:20:54 pm »
So is it possible to play more than 1 sounds at once?

ljbeng

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Play 10 sounds
« Reply #3 on: June 02, 2015, 07:25:26 am »
Yes.  Just look at the SpaceShip Sample program.  You will see they start the engine sound using SoundLoop then each time a missile is fired, they use SoundPlay and both are being blended at that time.

My mistake was using a single .snd file 10 times when I needed to make 10 .snd files and SoundAdd each one.