# Playing a sound fo each letter when text is animating

**URL:** <https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171>\
**Category:** Help\
**Created:** [29 January 2024 19:57 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171 "2024-01-29T19:57:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cogujada](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/cogujada/32/269_2.png) [@Cogujada](https://narrat.discourse.group/u/Cogujada)\
**Post date:** [29 January 2024 19:57 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171/1 "2024-01-29T19:57:35Z")

</div>

Hello, I am trying to make the characters sound when typed, similar to the example published at [https://demo.narrat.dev/](https://demo.narrat.dev/).  
I have saved the sound files letter-1.wav, letter-2.wav, … in public/audio  
The audio.yaml configuration file has content similar to the example:

```yaml
files:
   letter-a:
     src: audio/letter-1.wav
   letter-b:
     src: audio/letter-2.wav
   letter-c:
     src: audio/letter-3.wav
...
options:
   volume: 0.5
   musicFadeInTime: 0.5
   musicFadeInDelay: 0.5
   musicFadeOutTime: 0.5

audioTriggers: {}

dialogAudio:
   defaultAudio:
     soundPerLetter:
       prefix: letter-
   characterAudio:
     boss:
       soundPerLetter:
         prefix: letter-
     player:
       soundPerLetter:
         prefix: letter-

```

“boss” is a character in my program.

If in game.narrat I put  
play sound letter-a  
a beep sounds. But when the texts are written, nothing.

In the common.yaml file inside dialogPanel is animateText: true

I have searched and tried a lot, but I have not found anything. I have not found the configuration files for the example either. Some help?.

---

<div class="post-metadata">

**Author:** ![Narrat-Admin](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/narrat-admin/32/429_2.png) [@Narrat-Admin](https://narrat.discourse.group/u/Narrat-Admin)\
**Post date:** [29 January 2024 20:01 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171/2 "2024-01-29T20:01:48Z")

</div>

I wonder if it could just be from being on an old version and the feature not being there? The config file looks correct to me otherwise, and if the sound plays by itself it all looks good…

When you look at the inspector console in your browser, at some point early on in the logs it says which version of narrat is running, in green

![image](https://global.discourse-cdn.com/free1/uploads/narrat/original/1X/65b641373938c7f90c7290a35b51a84f52f1aa62.png)

If it has some older one, try updating (`npm install narrat@latest`). and if it’s not updating properly, try deleting the `node_modules` folder and then running `npm install` again.

If not that, I don’t know, are there any errors or anything weird going on?

---

<div class="post-metadata">

**Author:** ![Cogujada](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/cogujada/32/269_2.png) [@Cogujada](https://narrat.discourse.group/u/Cogujada)\
**Post date:** [29 January 2024 20:57 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171/3 "2024-01-29T20:57:13Z")

</div>

Thanks for answering.  
I think the problem is this:

 ![3](https://global.discourse-cdn.com/free1/uploads/narrat/original/1X/365560d3a2569655174333bf34945649f3a80a22.png)

The AudioContext was not allowed to start. …

But at the moment I haven’t seen how to solve it. It happens to me in all browsers. Any ideas?

---

<div class="post-metadata">

**Author:** ![Narrat-Admin](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/narrat-admin/32/429_2.png) [@Narrat-Admin](https://narrat.discourse.group/u/Narrat-Admin)\
**Post date:** [29 January 2024 21:24 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171/4 "2024-01-29T21:24:21Z")

</div>

The feature for those letter sounds was added in [3.8.0](https://github.com/liana-p/narrat-engine/blob/main/CHANGELOG.md#3-8-0)

You’re running an older one than that so you just need to update narrat

---

<div class="post-metadata">

**Author:** ![Cogujada](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/cogujada/32/269_2.png) [@Cogujada](https://narrat.discourse.group/u/Cogujada)\
**Post date:** [30 January 2024 13:51 UTC](https://narrat.discourse.group/t/playing-a-sound-fo-each-letter-when-text-is-animating/171/5 "2024-01-30T13:51:35Z")

</div>

It works now.

When updating the version it gave problems. I reinstalled everything and updated. Perfect.

Thank you very much for your help.
