Post by gavi on May 3, 2020 11:43:28 GMT
Hello,
using MA on the Oculus Quest here. Game has got a number of songs.
I closely followed the tutorial:
www.dtdevtools.com/docs/masteraudio/HowToCreateAddressableSFX.htm
I am using the following MA API to play the addressable song at a future time, both because I need to sync some game-things with the music, and also to have enough time to load the clip and hence to be sure of when the clip will really start playing:
finishingSong = currentSong;
currentSong = MasterAudio.PlaySound(trackId, delaySoundTime: currentSongWillStartTime - Time.realtimeSinceStartup);
if (currentSong != null && currentSong.SoundScheduled)
currentSong.ActingVariation.SoundFinished += OnCurrentSongFinished;
else
Debug.LogError("Could not schedule next song: " + trackId);
I keep a reference of the previous PlaySoundResult in the "finishingSong" variable in case I will need to interrupt it: it is correct, yes?
How can I ensure that the sound starts playing when expected? (in my case, as from the code above, at currentSongWillStartTime)
Should I load the addressable manually in advance?
Also, I will not need the last sound after it finished playing. Should I unload it manually?
Can you show me some code to achieve the above?
Or does MA do it all automatically because I am using the delaySoundTime option?
Also, how should I best import the clip? should I use "streaming" for songs? I am currently importing as "decompress on load":
I am also using "load in background" and "preload audio data".
What are the best best option for addressable songs kind of sounds to play in MA ?
using MA on the Oculus Quest here. Game has got a number of songs.
I closely followed the tutorial:
www.dtdevtools.com/docs/masteraudio/HowToCreateAddressableSFX.htm
I am using the following MA API to play the addressable song at a future time, both because I need to sync some game-things with the music, and also to have enough time to load the clip and hence to be sure of when the clip will really start playing:
finishingSong = currentSong;
currentSong = MasterAudio.PlaySound(trackId, delaySoundTime: currentSongWillStartTime - Time.realtimeSinceStartup);
if (currentSong != null && currentSong.SoundScheduled)
currentSong.ActingVariation.SoundFinished += OnCurrentSongFinished;
else
Debug.LogError("Could not schedule next song: " + trackId);
I keep a reference of the previous PlaySoundResult in the "finishingSong" variable in case I will need to interrupt it: it is correct, yes?
How can I ensure that the sound starts playing when expected? (in my case, as from the code above, at currentSongWillStartTime)
Should I load the addressable manually in advance?
Also, I will not need the last sound after it finished playing. Should I unload it manually?
Can you show me some code to achieve the above?
Or does MA do it all automatically because I am using the delaySoundTime option?
Also, how should I best import the clip? should I use "streaming" for songs? I am currently importing as "decompress on load":
I am also using "load in background" and "preload audio data".
What are the best best option for addressable songs kind of sounds to play in MA ?