File: short.py

package info (click to toggle)
pyvorbis 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 304 kB
  • ctags: 268
  • sloc: ansic: 2,424; python: 530; sh: 335; makefile: 63
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)