But none of these solution are working for me I updated the the code according to the
current APIs please check my script attached in which you will find both the methods
I referred from the links above.
What should I do?
There are a few things that will need to be fixed before you can use Unity Audio Clips.
Firstly enable Unity Audio again under the Unity toolbar Edit drop-down → Project Settings → Audio → Disable Unity Audio. Keep in mind with Unity Audio re-enabled the FMOD audio will no longer be heard on PS5 and Xbox.
Currently channel_group isn’t part of the FMOD signal chain so when we are calling RuntimeManager.CoreSystem.playSound() with the channel_group as it is, it won’t be heard. The easier way to fix this is to assign channel_group to the MasterChannelGroup as this is where all sound eventually goes. To do this we will call FMODUnity.RuntimeManager.CoreSystem.getMasterChannelGroup(out channel_Group). So now when we call playSound() the audio from the clip will be heard as it is part of the MasterChannelGroup.
A tip, call Debug.Log() on the output of result each time it is assigned, rather than just at the end of the function. Logging the results value at the end of the function will just be its most recent assignment.
Lastly, make sure that channel.setPaused() is set to false to allow the sound to play.
Hopefully, this will allow the Audio Clip to play!
I know it’s an old topic, but I’m completely stuck on this. I tried using d23’s code above, it runs fine, and I can see a sound channel playing but there’s no volume (neither from the speakers or in the debug panel).
The sound file works fine if I use FMODUnity.RuntimeManager.CoreSystem.createSound(path, FMOD.MODE.DEFAULT, out fmodSound).
But this doesn’t work on android, so it would be better to create it from an audioclip.
The sound file is .wav file with the following settings;