File: short.py

package info (click to toggle)
pyvorbis 1.3-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 252 kB
  • ctags: 264
  • sloc: ansic: 2,339; python: 535; makefile: 65
file content (19 lines) | stat: -rwxr-xr-x 367 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

'''short.py - a really brief demonstration of using the ao and ogg modules'''

import ogg.vorbis
import ao

filename = 'test.ogg'
device = 'esd'
SIZE = 4096

vf = ogg.vorbis.VorbisFile(filename)
id = ao.driver_id(device)
ao = ao.AudioDevice(id)

while 1:
    (buff, bytes, bit) = vf.read(SIZE)
    if bytes == 0: break
    ao.play(buff, bytes)