# Is it possible to use an Fmod Studio project from a unity build?

**URL:** <https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 30, 2022, 8:45am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818 "2022-05-30T08:45:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [May 30, 2022, 8:45am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/1 "2022-05-30T08:45:08Z")

</div>

This may be a weird question, but let’s say I have a game I made in Unity, and it has a music system that listens for Markers in Fmod.

Then I create a level editor for said game.

Would it be possible for my game to load and play a user-created Fmod Studio project and listen for Markers?

Or would I be better off using something else for the custom music?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [May 30, 2022, 9:04am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/2 "2022-05-30T09:04:18Z")

</div>

yes it is possible but it is too complex  
I have tried it for myself as well  
but it wont be the project file you can use because project file contains the information for the specified SOUND  
there is a file which is placed near the project file known as the fsb or FMOD SOUND BANK  
The fsb contains the audio  
you can use FMOD API to retrieve the sound from that fsb if its not encrypted

```
			var result = FMOD.Factory.System_Create(out var system);

			result = system.setOutput(FMOD.OUTPUTTYPE.WAVWRITER);

			result = system.init(32, FMOD.INITFLAGS.NORMAL, System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(Path.Combine(outputDirectory, $"{name}.wav")));

			result = system.createSound(args[0], FMOD.MODE._2D | FMOD.MODE.LOOP_OFF | FMOD.MODE.CREATESTREAM, out var sound);

			result = sound.getSubSound(i, out var subsound);

			result = system.playSound(subsound, null!, false, out var channel);

			do
			{
				result = system.update();
				if (channel is not null)
				{
					result = channel.isPlaying(out bool playing);
					if (!playing)
						break;
				}
			} while (true);

			result = sound.release();
			result = system.close();
			result = system.release();
```

---

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [May 30, 2022, 9:13am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/3 "2022-05-30T09:13:22Z")

</div>

Wow thanks! I was wondering what the sound bank file held exactly.

So does this work with marker callbacks and such or is it just the sound?

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [May 30, 2022, 9:15am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/4 "2022-05-30T09:15:17Z")

</div>

as i said that it is too complex so i cant just explain everything here  
Here is my discord id where you can ask me in detail

mov eax,Bits&Bytes#6282

As for now i am also free so i can help

---

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [May 30, 2022, 9:18am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/5 "2022-05-30T09:18:08Z")

</div>

Ah thanks. It’s not really urgent or anything so it can wait, just curious to see if it’ll be an option further down the road once the game is ready to have a level editor.

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [May 30, 2022, 9:19am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/6 "2022-05-30T09:19:23Z")

</div>

good  
hey do you know how to use FMOD low level api to create fsb files  
I cant somehow initialize the file

---

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [May 30, 2022, 9:28am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/7 "2022-05-30T09:28:23Z")

</div>

I honestly don’t know how to do that yet, just recently got into Fmod so I’ve got quite a bit to learn. I thought I saw a post about not initializing somewhere on the forum, I’ll update you if I find it.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 31, 2022, 4:53am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/8 "2022-05-31T04:53:10Z")

</div>

It is possible to do this.There are two options:

The first is to provide a template project for users to add their music to an event, giving instructions on not to move markers, etc from the music event template. This does run the risk of users not reading the instructions carefully enough and causing some issues, but otherwise is the simplest solution. You can find information on how to support user-generated content here:

[https://www.fmod.com/resources/documentation-studio?version=2.02&page=supporting-downloadable-and-user-generated-content.html](https://www.fmod.com/resources/documentation-studio?version=2.02&page=supporting-downloadable-and-user-generated-content.html)

The second option is to have the music event use a programmer instrument, then have a custom system set up for the user to provide their music file(s) directly to the game. This is way guarantees the markers won’t be moved, but does require a little bit more setup. For more information on how to use programmer instruments, please check out the `programmer_sound` example in the FMOD Studio API installation examples, and read more here:

[https://www.fmod.com/resources/documentation-studio?version=2.02&page=glossary.html#programmer-instrument](https://www.fmod.com/resources/documentation-studio?version=2.02&page=glossary.html#programmer-instrument)

[https://www.fmod.com/resources/documentation-unity?version=2.02&page=examples-programmer-sounds.html](https://www.fmod.com/resources/documentation-unity?version=2.02&page=examples-programmer-sounds.html)

---

<div class="post-metadata">

**Author:** ![bloo\_regard\_q\_kazoo](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bloo\_regard\_q\_kazoo](https://qa.fmod.com/u/bloo_regard_q_kazoo)\
**Post date:** [May 31, 2022, 8:52am UTC](https://qa.fmod.com/t/is-it-possible-to-use-an-fmod-studio-project-from-a-unity-build/18818/9 "2022-05-31T08:52:54Z")

</div>

The user generated content section looks like it’ll be incredibly useful for my purposes. Actually, both will be useful cause the programmer instrument will provide an easier (but less customizable) option to the player, in addition to the UGC.

Thanks!!
