Example #1
0
File: short.py Project: azoon/pymt
#!/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)
Example #2
0
def write_callback(dec, buff, size):
    # print dec.get_decode_position()
    ao.play(buff, size)
    return decoder.FLAC__STREAM_DECODER_OK
Example #3
0
#!/usr/bin/env python

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

import hip
import ao
import sys

filename = sys.argv[1]
device = 'esd'
SIZE = 4806

hf = hip.hip(filename)
id = ao.driver_id(device)
ao = ao.AudioDevice(id)

while 1:
    (buff, bytes, bit) = hf.read(SIZE)
    if bytes == 0: break
    ao.play(buff, bytes)
Example #4
0
def write_callback(dec, buff, size):
    # print dec.get_decode_position()
    ao.play(buff, size)
    return decoder.FLAC__STREAM_DECODER_OK