Slowing down sounds

11 views
Skip to first unread message

Noyan Tokgozoglu

unread,
Nov 9, 2008, 12:20:49 PM11/9/08
to pyglet-users
Is it possible to slow down sounds in pyglet? Like in slow motion
sequences of movies etc where someone says "way" it goes "wooaaaaaaay"

Sorry for the silly explanation, but I'm sure you'll understand me.

Thanks.

Nathan Whitehead

unread,
Nov 9, 2008, 12:47:19 PM11/9/08
to pyglet...@googlegroups.com
On Sun, Nov 9, 2008 at 9:20 AM, Noyan Tokgozoglu <cladin...@gmail.com> wrote:
>
> Is it possible to slow down sounds in pyglet? Like in slow motion
> sequences of movies etc where someone says "way" it goes "wooaaaaaaay"

Yes, if you're using the OpenAL sound driver. Suppose snd is a sound
you want to play back slowly. Do:

player = pyglet.media.Player()
player.queue(snd)
player.pitch = 0.5
player.play()

This will play at half speed so it will sound one octave down.

If you are using Windows or Linux you may have to install the latest
OpenAL sound drivers. In Linux, especially, older OpenAL drivers are
very buggy (get OpenAL-soft).

To declare that you want to use OpenAL or nothing, at the beginning of
your program do:
pyglet.options['audio'] = ('openal', 'silent')
--
Nathan Whitehead

Reply all
Reply to author
Forward
0 new messages