22.8. Declaring and playing back sounds

| Chapter 22: Figures, Sounds and Files |

| 22.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;

Previous | Contents | Next