![]() This was used in my game to slow all the songs down 20% because I only realised after composing the music that it was too difficult.Īnyway, now that we have set up our Conductor, time to take care of the objects that need to sync to it!Ģ. By incorporating it into my song position variable, I can change the playback speed and still keep everything in sync. Songposition = (float)(AudioSettings.dspTime – dsptimesong) * song.pitch – offset Īside: the song.pitch is an inbuilt variable in Unity that gives the speed the song is playing at. What I do is, in the same frame that I play the song, I record the dspTime at that moment, so then my song position variable is set on every frame as follows: This varies from engine to engine, but in Unity for example, the variable to use is AudioSettings.dspTime. Songposition, a variable that should be set directly from the corresponding variable on the Audio object.
0 Comments
Leave a Reply. |