I’m relatively new to FMOD and could use some help with implementing 3D sound in Unity using FMOD. I’ve successfully integrated sound from a VideoPlayer using example code (“11. Scripting Examples | Video Playback”), but I’m struggling to make it 3D. While I’ve managed to set sound parameters in the “createSound” method, I can’t figure out how to change the sound position; it’s always at (0,0,0).
Additionally, I’m looking to connect the sound source to the mixer in FMOD Studio for volume control, but I’m unsure about the process.
I’m just starting with this plugin, and this is the only part giving me trouble. Any tips or guidance would be greatly appreciated.
All you should need to do is make sure use the FMOD_MODE FMOD_3D when creating your sound. Then, when the sound is playing on a channel, you can use ChannelControl::set3DAttributes to set its position.
This is where it gets a little more complex. Studio uses the Studio API, which is the higher level system built on the lower level Core API. It is possible to directly interact with the Core API when using the Studio API, which, is what the Video Player example does, but some Studio API features may not be available to you, especially those that are set up at design time in Studio.
That said, if you’re only wanting to control volume using a Bus, it should be a fairly simple matter of getting the desired bus, getting its underlying ChannelGroup with Studio::Bus::getChannelGroup, and then playing your video player sound on that channel group. Doing so will route the sound’s signal to that bus, meaning that the bus’ effects and volume should affect the sound as well.