I was just wondering if there have been any major developments in support for sound? All the posts I could find were from a good few years ago.
I’m just trying to put a soundtrack in the game that will play in the background throughout.
I have access to it on Mac and PC but can’t seem to get it to work on either.
It seems to recognise and compile the game but I can’t get it to play. I’ve tried triggering it in the game and the source code. Play doesn’t seem to be a verb Inform recognises.
Sound of soundtrack is the file "sky track mix 11.aiff".
Sound is being worked on as we speak for Parchment and normal inform.
In the mean time though I’ve made an extension and custom interpreter that makes it work just fine. You can see it here (documentation in second post):
You’ll need to download an old version of Glulx Entry Points, which is available here:
There are some annoyances (you need to put .ogg files in one folder for it to compile and .mp3 files in another to get it to play online) but there are at least two games out there using it now with working sound. Here is a working example by Wade Clarke: https://wadeclarke.com/if/six/
Edit: By the way, sound should be working offline, such as in the inform interpreter. That’s kind of weird if it’s not already doing that.
You probably got this as it seems you read the docs, but make sure your sound source files are in the correct location per 23.8. Declaring and playing back sounds
§23.8. Declaring and playing back sounds
Sound effects are accommodated on the same basis as illustrations. The relevant media files need to be placed in a subfolder of the project’s “.materials” folder, but this time called Sounds rather than Figures, so for instance:
Sound of rustling leaves is the file "Rustling leaves.ogg".
And they can be played using a special phrase:
play (sound name)
This phrase causes the sound effect to be played. If the option “one time only” is used, it will have no effect if the sound effect has been played before. Example:
play the sound of rustling leaves;
I don’t remember if the IDE plays sounds by default on Mac. That may have been updated since I last made a sound project. I may be misremembering that I had to publish and play the gblorb to test sounds.
Thank you for your reply. Yes I read the docs and created the Sounds folder etc…I did see something in what you just sent me I may have overlooked/misunderstood:
play (sound name)
This phrase causes the sound effect to be played. If the option “one time only” is used, it will have no effect if the sound effect has been played before.
When I try and write this in the game or in the source code I get a version of
‘that’s not a verb i recognise/know what to do with’
Is there something I’m missing in my code…playing is an action etc that i need to include?