# Can I use programmer instrument to play wav files from a local folder?

**URL:** <https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301>\
**Category:** Unity\
**Created:** [December 9, 2019, 11:54pm UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301 "2019-12-09T23:54:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GiacomoF](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GiacomoF](https://qa.fmod.com/u/GiacomoF)\
**Post date:** [December 9, 2019, 11:54pm UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301/1 "2019-12-09T23:54:09Z")

</div>

Hello,

I am investigating whether it is possible to give players the ability to run audio through an event in FMOD.  
Case in point, I would like the ability to let players run their own music through my music system. Back in my days I remember games like GTA Vice City and The Sims that allowed players to populate any number of songs into a folder and the game would then play those tracks through their in-game “radio system”.

What I am looking for is something a little bit more nuanced: not just the ability to play audio as is, but also to use the same in-game music logic on their music of choice.

However the more I thought about this, the more I also realize that these days people listen to music mostly on streaming services. A more advanced feature could be one where the game has a sort of audio input that listens to whatever the user chooses to assign to.

Are any of these ideas even doable in principle?

Cheers

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [December 10, 2019, 1:13am UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301/2 "2019-12-10T01:13:09Z")

</div>

> [@GiacomoF](#):
>
> I would like the ability to let players run their own music through my music system. Back in my days I remember games like GTA Vice City and The Sims that allowed players to populate any number of songs into a folder and the game would then play those tracks through their in-game “radio system”.
> 
> What I am looking for is something a little bit more nuanced: not just the ability to play audio as is, but also to use the same in-game music logic on their music of choice.

You can achieve this trivially by using [programmer instruments](https://www.fmod.com/resources/documentation-studio?version=2.0&page=working-with-instruments.html#programmer-instruments). You would just need to add some code to your game that checks a certain directory for audio files and passes their names to FMOD Studio when needed. Other than that, a programmer instrument functions like any other instrument, and can exist within as complex a framework of timeline and conditional logic as you care to create.

> [@GiacomoF](#):
>
> However the more I thought about this, the more I also realize that these days people listen to music mostly on streaming services. A more advanced feature could be one where the game has a sort of audio input that listens to whatever the user chooses to assign to.

The FMOD Studio API supports certain forms of internet streaming, as described [here](https://www.fmod.com/resources/documentation-api?version=2.0&page=core-guide.html#internet-streaming) in the [FMOD API User Manual](https://www.fmod.com/resources/documentation-api?version=2.0&page=welcome.html).

---

<div class="post-metadata">

**Author:** ![GiacomoF](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GiacomoF](https://qa.fmod.com/u/GiacomoF)\
**Post date:** [January 9, 2020, 8:02pm UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301/3 "2020-01-09T20:02:40Z")

</div>

Hello Joseph,

is a Spotify integration possible in FMOD?  
Officially Spotify doesn’t support videogame integrations [https://community.spotify.com/t5/Live-Ideas/Partnership-SDK-for-Video-Game-Integration/idi-p/1249346](https://community.spotify.com/t5/Live-Ideas/Partnership-SDK-for-Video-Game-Integration/idi-p/1249346)

But the game Dangerous Driving does, which seems to be using FMOD.

Could you give me some insight please? thank you

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [January 9, 2020, 11:30pm UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301/4 "2020-01-09T23:30:57Z")

</div>

> [@GiacomoF](#):
>
> Officially Spotify doesn’t support videogame integrations [[Partnership] SDK for Video Game Integration - The Spotify Community](https://community.spotify.com/t5/Live-Ideas/Partnership-SDK-for-Video-Game-Integration/idi-p/1249346)
> 
> But the game Dangerous Driving does, which seems to be using FMOD.

We are not privy to Dangerous Driving’s code, so we don’t know how Three Fields Entertainment did it.

I suspect they may have used one of Spotify’s [existing APIs](https://developer.spotify.com/documentation/) to obtain a stream which could then be fed to the FMOD Engine as per [our documentation on internet streaming](https://www.fmod.com/resources/documentation-api?version=2.0&page=core-guide.html#internet-streaming). This is, however, just speculation on my part.

Perhaps you could [contact Three Fields Entertainment](https://www.threefieldsentertainment.com/contact/) for information on this topic?

---

<div class="post-metadata">

**Author:** ![GiacomoF](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GiacomoF](https://qa.fmod.com/u/GiacomoF)\
**Post date:** [January 9, 2020, 11:56pm UTC](https://qa.fmod.com/t/can-i-use-programmer-instrument-to-play-wav-files-from-a-local-folder/15301/5 "2020-01-09T23:56:00Z")

</div>

Yes I have done that and also emailed Spotify 🙂
