Inform 7 Home Page / Documentation


§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:

Example.inform
Example.materials
    Figures
        Woodlands.png
        Blackberry.jpg
        Red Admiral Butterfly.png
    Sounds
        Rustling leaves.ogg

Again, these must be declared in the source text:

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;


arrow-up.png Start of Chapter 23: Figures, Sounds and Files
arrow-left.png Back to §23.7. Recorded sounds
arrow-right.png Onward to §23.9. Providing accessibility text