pyao makes the right sound but why?

'2+ electriclightheads at
Wed Mar 3 15:50:09 CET 2010

with my

tofu = soy.Bean()
x = tofu.pattern(44100 * 3)

creates x which is an array('h') and len(x) = 44100 * 6
this x is a stereo groove pattern that lasts 3 sec if samplerate is set to 44100
and since could save it to a_file.wav
i was wondering if

dev = ao.AudioDevice('alsa')

could launch me a semi realtime dj kinda sys
luckily .. it does seem to be making the right sound
but why?
the default of the samplerate and that 16bit happened to match with my thing x?
o but if i do, len(x))

it only plays the half of the pattern
and, 2 * len(x))

does the right thing

and the 2nd 4th 6th .. play gives me

ALSA underrun, at least 0ms

3rd, 5th, 7th does it fine

doesn't teach me the answer
does somebody know more about pyao?

SaRiGaMa's Oil Vending Orchestra
is podcasting:

More information about the Python-list mailing list