[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] SndArray Question
I've built a crude speech synthesizer, and am thinking about how it
could be improved. I'm having trouble, though, because I don't
understand the format that Pygame uses in its SndArray module. Eg:
CHIMES = "chimes.wav" ## The name of a WAV file in this directory.
pygame.init()
x = pygame.mixer.Sound(CHIMES)
x_arr = pygame.sndarray.array(x)
x_arr[:5] ## Look at the first few entries.
Result:
array([[2, 3],
[9, 6],
[7, 2],
[5, 0],
[3, 3]],'s')
What does this data mean, exactly? I assume that since the length
depends on the sound's length and each entry is a two-part list, and the
pairs of numbers usually are the same, each entry represents stereo
frequency data at a point in time. Is this so? If so, where's the volume
data?
Kris