|
pygame.sndarray.array | copy Sound samples into an array |
pygame.sndarray.samples | reference Sound samples into an array |
pygame.sndarray.make_sound | convert an array into a Sound object |
Functions to convert between Numeric arrays and Sound objects. This module will only be available when pygame can use the external Numeric package.
Sound data is made of thousands of samples per second. Each sample is an 8-bit or 16-bit integer, depending on the data format. A stereo sound file has two values per sample, while a mono sound file only has one.
Numeric does not use unsigned 16-bit integers; they will be converted to signed 16-bit arrays.
Creates a new Numeric array for the sound data and copies the samples. The array will always be in the format returned from pygame.mixer.get_init.
Creates a new Numeric array that directly references the samples in a Sound object. Modifying the array will change the Sound. The array will always be in the format returned from pygame.mixer.get_init.
Create a new playable Sound object from a Numeric array. The mixer module must be initialized and the array format must be similar to the mixer audio format.