1
Audio / Re: No compile errors, yet no sound.
« on: November 29, 2018, 08:08:41 pm »Hey.
Your SoundBuffer and Sound are destroyed at the end of the scope they are declared in (like any local variable). In your code they are destroyed just after "s.play();" so it doesn't even have enough time for you to hear it.
Declare them somewhere else where their lifetime is longer.
Hello, thanks for the answer.
When calling sound.play(), isn't a new thread aumatically created to play that sound and when it ends the thread dies?
What approach could I use to play a sound whenever the player clicks left mouse button? I don't know, I might be missing something still...