# Play sounds when a letter is shown

To implement typewriter sounds in your game, you can subscribe to the Typewriter’s “`OnCharacterVisible`” event and play sounds based on it.

The event passes a “char” as a parameter, so you can play different sounds based on different letters as well.

*P.S. The event is also triggered with spaces, so be sure to play sounds based on the type of character you prefer.*

***

### Example Package <a href="#example-package" id="example-package"></a>

As an example, you can install the “TypeWriter Sounds” package found inside the “Extra” folder and check its implementation.

![](https://content.gitbook.com/content/XuXUTa2X5PYuYL6yRvl1/blobs/Lld5xGmtqLsHHY6U2x1g/Untitled.png)

<table><thead><tr><th width="221">Variable</th><th>Explanation</th></tr></thead><tbody><tr><td><code>Source</code></td><td>Main audio source where sounds will be played</td></tr><tr><td><code>MinSoundDelay</code></td><td>Minimum time that has to pass before playing another sound</td></tr><tr><td><code>Interrupt Previous Sound</code></td><td>If true, the previous audio will be stopped</td></tr><tr><td><code>Random Sequence</code></td><td>If true, the next audio clip to play will be chosen randomly from the “Sounds” array. If false, sounds will be played subsequently</td></tr><tr><td><code>Sounds</code></td><td>Typewriter sounds to play</td></tr></tbody></table>
