This is a script to change the sound speed in real time like for example background music in pygame.
The script generates the raw data of a sound file each time there is space in the queue. The sample will scale to the desired speed which you can modify with sound_Factor.
To play the music, you just need to get buffers from the queue and pass them to your music stream. Exemple for pygame :
# musique update
if channel.get_queue() == None: