How to add audio in a FMOD+Unity build

I am using FMOD for beat detection for audio used in-game but my issue is that I want to add an audio file into my unity game build and play the audio file with beat detection working on it.
I am using Audio tables to store audio references in the game user can import audio files through unity and will be added to the source path of the Audio table but to play that in unity I have to click on FMOD build to regenerate , so is there any way that I can call Build FMOD event through unity and refresh banks in unity?

1 Like

Yes, I am also facing this issue can someone help on it?

Hi,

Just wanted to clarify what the problem is, are you wanting to create new events from the Unity editor without going into FMOD studio?

This can be done by clicking the plus icon on an “Event Reference” in the Unity Editor.

image

Bringing up this window which will allow you to create the new event, assign it to a bank and choose where to save it. All from within Unity.

image

Let me know if this helps

1 Like

Hi @Connor_FMOD,
This is not exactly what I am looking for, my issue is that in an Unity build which we run on a device(for example .apk file for mobile devices) I want to add a local audio file and play it through FMOD Studio Event Emitter component in unity. Because I want the user to add their own choice of music in the application with beat detection through FMOD.

I hope this makes the requirement a bit clearer.
Thanks

Hi,

Thanks for clarifying,

To do this you’ll have to use Programmer Instruments, their setup can be found in the Working With Instruments section of the FMOD Studio docs. In conjunction with Programmer Sounds, an example of how to use these together can be found in the Scripting Examples section of the Unity Integration docs.

In the example instead of using SteamingAssetsPath in the createSound function, you will want to use the exact directory location of the audio file. Also, ensure that you have read permissions on the device to read the audio from the file.

However, FMOD does not have the functionality to allow for beat detection if you could elaborate further on how you are doing this I may be able to assist.

I hope this answers your questions better!

1 Like

Hi @Connor_FMOD
Thank you for the speedy resolution I think I have found the solution for this query.

There is a little query that I want to ask :- Can I change the starting tempo of an event through unity C# code? If possible how should I do it?

Thanks!!!

Hi,
Happy to hear we could resolve the issue,

In regards to your new query, could you elaborate on what you are trying to do with changing the tempo from code?

1 Like