![]() ![]() ![]() Soloud.calcFFT()Ĭalculates FFT of the currently playing sound (post-clipping) and returns a pointer to the result. The default maximum number of global filters active is 4, but this can be changed in a global constant in soloud.h (and rebuilding SoLoud). Setting the global filter to NULL will clear the global filter. tGlobalFilter(0, &echochamber) // set first filter tMaxActiveVoiceCount(voices / 2) tGlobalFilter() Int voices = gSoloud.getMaxActiveVoiceCount() If voice count is higher than the maximum active voice count, SoLoud will pick the ones with the highest volume to actually play. Get or set the current maximum active voice count. If (soloud.getVoiceCount() > 1000) lots_of_voices() tMaxActiveVoiceCount(), Soloud.getMaxActiveVoiceCount() Returns the number of voices the application has told SoLoud to play. If (untAudioSource(cheer) = 3) three_cheers() Soloud.getVoiceCount() Returns the number of concurrent soudns that are playing a specific audio source. If (soloud.getActiveVoiceCount() = 0) enjoy_the_silence() untAudioSource() Returns the number of concurrent sounds that are playing at the moment. If the handle is invalid, the isValidVoiceHandle will return 0. ![]() If (!soloud.isValidVoiceHandle(h)) delete foobar The isValidVoiceHandle function can be used to check if a handle is still valid. If (soloud.getStreamPosition(music) > 30) past_the_good_bit() Soloud.isValidVoiceHandle() Gets the stream position of a specific voice handle. While not perfect, that's way better than using the stream time directly. Mytime = (mytime * 9 + soloud.getStreamTime(h)) / 10 To fix this, either use some other clock source and only sync with the stream time occasionally, or use some kind of low-pass filter, such as. Note that time is a double instead of float because float will cause precision problems within 24 hours of playing, and eventually, in about 6 days, will cause the "time" to stop.Īlso note that the granularity is likely to be rather high (possibly around 45ms), so using this as the sole clock source for animation will lead to rather low framerate (possibly around 20Hz). The getStreamTime function can be used to get the current play position, in seconds.ĭouble t = soloud.getStreamTime(h) // get time ![]()
0 Comments
Leave a Reply. |