Sound and video

pyglet can play many audio and video formats. Audio is played back with either OpenAL, DirectSound or ALSA, permitting hardware-accelerated mixing and surround-sound 3D positioning. Video is played into OpenGL textures, and so can be easily be manipulated in real-time by applications and incorporated into 3D environments.

Decoding of compressed audio and video is provided by AVbin, an optional component available for Linux, Windows and Mac OS X. AVbin is installed alongside pyglet by default if the Windows or Mac OS X installation is used. If pyglet was installed from source, AVbin can be installed separately.

If AVbin is not present, pyglet will fall back to reading uncompressed WAV files only. This may be sufficient for many applications that require only a small number of short sounds, in which case those applications need not distribute AVbin.