SFML community forums
Help => Audio => Topic started by: CosminPerRam on July 12, 2017, 12:04:39 pm
-
Hello fellas, i wonder if there's a way to change the tempo/speed of the music? Even when the music is running? And also, how i can see at what second is the music at the moment? Also, im beginner in C++. Thanks in advance!
-
ahh...you did what I told you ;D
altho I cannot provide an answer
-
The pitch is the only thing you can change that has an effect on the music speed:
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1SoundSource.php#a72a13695ed48b7f7b55e7cd4431f4bb6
For the current playback position:
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1SoundStream.php#a6070416e1e1a11b5915e9314dd6638f7
-
The pitch is the only thing you can change that has an effect on the music speed:
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1SoundSource.php#a72a13695ed48b7f7b55e7cd4431f4bb6
For the current playback position:
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1SoundStream.php#a6070416e1e1a11b5915e9314dd6638f7
Is there a reason why when you set the pitch higher the sound gets sped up?
-
Yes, a higher pitch has a higher frequency so increasing the pitch technically just increases the speed at which the samples are played back.
-
Yes, a higher pitch has a higher frequency so increasing the pitch technically just increases the speed at which the samples are played back.
But how do programs like Audacity manage to up the pitch while maintaining the same speed of the sound?
Or is this delving into something too complicated to explain?
-
But how do programs like Audacity manage to up the pitch while maintaining the same speed of the sound?
They use more complicated algorithms, that are not part of OpenAL (and therefore SFML).