Jump to content
  • Advertisement
Sign in to follow this  
george7378

irrKlang: Playing a sound once?

This topic is 1958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

I'm using the irrKlang sound engine in my game, and I am having a little problem. Let's say I want to play a sound when a certain event happens, i.e. when a certain location is passed or a certain object is used. If I just call play2D() when the event happens, then every frame, the sound will be played from the beginning again as long as the condition is satisfied, resulting in a constant loop of the sound being played freshly every frame.
So my question is, for anyone else who uses this API: How can I play a sound in irrKlang once and once only in this situation? i.e. only play it the first time the game detects that the condition is satisfied, rather than every time?

Thanks, I hope that was clear!

Share this post


Link to post
Share on other sites
Advertisement

I've never used that API, but I would guess that the event/trigger is the problem area.  If the trigger that the event references has 'properties' of any kind that you can easily modify, I would check that those properties don't have a value allowing infinite triggering.  I had a similar issue in UDK that I resolved this way.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!