Add Individual sound effects to different pages?

Hi, one of my close friends is an audio sound designer and he’s made a bunch of sound effects for my game. I read the choicescript wiki and it only talks about adding a sound track to the game? How do I add individual sound effect to each pages ? like a frag gernade exploding for example? I can’t seem to find any info on that, a message board in 2010 said this feature will be added in the future… and it’s almost 2015 now, it would be a big difference if I can use the sound effects my friend made for me.

On another note, I faintly remember playing a CoG game (hosted or not can’t remember) that HAD this feature, it was playing a sound effect on different pages, I can’t remember which game this is for the life of me, but I know it’s possible and somebody has done it. Any one can please shed some light on this ? My friend will be sad if I tell him I can’t use any of the sounds he made for me, he put in lots of effort into it too…


Not sure, but I think Samuel , author of that demon game, may be able to help you.

There is a *sound command which can be used to this effect, but there’s very little documentation on it at the moment. I believe it works similar to *image, so you put your sound files into the mygame folder and then call them in code like:

*sound mySound.mp3

I use sound bites in my wip. This is gosub call if sound was turned on or off by the player.

*label thunk
*if (sound_file)
 *sound sound/effects/thunk.mp3

Irish, why not just:

*label thunk
*if (sound_file)
    *sound sound/effects/thunk.mp3

Sometimes my code gets so long it is far simpler for me to spot and make sure I have it coded correctly. Some page reach 4456 lines of code.

wow, thanks guys! really appeciated, im excited to try it out, so basically *sound follow by the path of the sound file? default in mygame folder?

It took a bit of digging but I managed to find a related topic to this that might help.

That person was also interested in working with the sound and started that topic in order to find a way to make it function in their story. There were apparently some complications with getting certain sound commands to work on smart phones, and I’m not entirely sure if the issues were resolved or not. @Lordirish probably knows more about the details than me.

I hope we can get it to work though. Adding the crackle of fire or the patter of rain to specific scenes can really help immersion if you ask me.

If you plan on submitting your game to CoG it is not a good idea to mod. They may not support it, and from my understanding they have sound figured out already, I would just use the *sound. I have mod a few times playing with sound formats, but find it does not always work better then what is implemented.

Ya i’m not planning to mod, the function *sound is perfect for what i need already.

This looks really interesting, I’m trying to get this sorted too…
In the second line, obviously you have to create a variable sound_file, right?
And the third line, is that a file path you have listed there?
If so, where do you put the folder “sound”? Is it in mygame?
Final question, why the need for a gosub routine? Can you not just include it in the code as needed? Or does it have to be part of a gosub routine?
I’m a bit of a noob at this so thanks in advance for your patience!