Continuous Sound while button is held...

Hi there,

I guess my post title summarizes it  :)

I need to play a continuous “rocket engine” sound for as long as the player pressed and holds a button.

I have created a very short sound clip (a VERY short portion of a rocket sound) that I would play in a enterFrame listener as long as the button pressed “flag” is ON, hoping it will create a smooth, sustained sound when played in succession.

However, I didn’t get the sound I was expecting.  It’s more like a choppy, very rapid succession of the clip that sounded more like a 1000-round-per-second Gatling gun.

Any suggestion?  

Thanks in advance

santi

Hey santi,

Maybe you could use a rocket sound that is longer (maybe 5 seconds) that is set to play as a loop:

Start playing the audio file on the began phase of the touch, and stop it on the ended phase.

The longer audio file will prevent the staccato (machine gun) sound that you hear, which is from playing the same sound in rapid succession.  

Looping a very short audio file can produce ‘popping’ sounds if the waveform’s beginning and end aren’t continuous.

Hi  r.delia,

Thanks for the suggestion.  I have tried it but it produces the same effect (and much worse) because the audio clip is longer and it is going to be played over and over in rapid succession.

I have found a solution!!  

I used a longer sound, say 5 seconds, and play it in endless loop at the start of the level BUT set its volume to zero.  Once the player presses the “thruster button”, I set the volume to say, 0.3 and set it back to 0.0 once the touch event ended.  :)

Whats good about this method is I can play around with the volume in varying levels, depending on the amount of thrust applied.  Say for example the player selects maximum thrust, then I can set the volume to 1 for a much louder sound, giving the impression of rocket engine feedback  :)

Cheers!

Santi

Hey santi,

Maybe you could use a rocket sound that is longer (maybe 5 seconds) that is set to play as a loop:

Start playing the audio file on the began phase of the touch, and stop it on the ended phase.

The longer audio file will prevent the staccato (machine gun) sound that you hear, which is from playing the same sound in rapid succession.  

Looping a very short audio file can produce ‘popping’ sounds if the waveform’s beginning and end aren’t continuous.

Hi  r.delia,

Thanks for the suggestion.  I have tried it but it produces the same effect (and much worse) because the audio clip is longer and it is going to be played over and over in rapid succession.

I have found a solution!!  

I used a longer sound, say 5 seconds, and play it in endless loop at the start of the level BUT set its volume to zero.  Once the player presses the “thruster button”, I set the volume to say, 0.3 and set it back to 0.0 once the touch event ended.  :)

Whats good about this method is I can play around with the volume in varying levels, depending on the amount of thrust applied.  Say for example the player selects maximum thrust, then I can set the volume to 1 for a much louder sound, giving the impression of rocket engine feedback  :)

Cheers!

Santi