# Sound parameter in a Function

**URL:** <https://forum.makecode.com/t/sound-parameter-in-a-function/42875>\
**Category:** Help\
**Created:** [March 23, 2026, 10:22pm UTC](https://forum.makecode.com/t/sound-parameter-in-a-function/42875 "2026-03-23T22:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLADEr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blader/32/16422_2.png) [@BLADEr](https://forum.makecode.com/u/BLADEr)\
**Post date:** [March 23, 2026, 10:22pm UTC](https://forum.makecode.com/t/sound-parameter-in-a-function/42875/1 "2026-03-23T22:22:22Z")

</div>

I’m making a game where I want to use the same function to give dialog to different characters.  
Is there a way to add sound to be a parameter in a function? I just don’t want to have to do something like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/7/87e1ccec99b257ce0e65dd3c55def5a8de8fda3b.png)

If this is not possible, I will suffice with just adding all the numbers into the function, but I think it would be nice to have sound as a parameter.

Does anyone have more knowledge on this?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [March 23, 2026, 10:25pm UTC](https://forum.makecode.com/t/sound-parameter-in-a-function/42875/2 "2026-03-23T22:25:57Z")

</div>

well, there’s the classic “pass in an array of one item” hack:

 ![arcade-screenshot (3)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/2/b2578460f7f5a59ddc2cf7ee099cc1ccf1ec01d4.png)

> **[pass-as-array-hack](https://arcade.makecode.com/72398-24198-62412-22822)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.
