|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|
|pygame.sndarray.use_arraytype||—||Sets the array system to be used for sound arrays|
|pygame.sndarray.get_arraytype||—||Gets the currently active array type.|
|pygame.sndarray.get_arraytypes||—||Gets the array system types currently supported.|
Functions to convert between numpy arrays and Sound objects. This module will only be available when pygame can use the external numpy package.
Sound data is made of thousands of samples per second, and each sample is the amplitude of the wave at a particular moment in time. For example, in 22-kHz format, element number 5 of the array is the amplitude of the wave after 5/22000 seconds.
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.
Creates a new 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 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 an array. The mixer module must be initialized and the array format must be similar to the mixer audio format.
DEPRECATED: Uses the requested array type for the module functions. The only supported arraytype is 'numpy'. Other values will raise ValueError.
DEPRECATED: Returns the currently active array type. This will be a value of the get_arraytypes() tuple and indicates which type of array module is used for the array creation.
New in pygame 1.8
DEPRECATED: Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the pygame.sndarray.use_arraytype()Sets the array system to be used for sound arrays () method. If no supported array system could be found, None will be returned.
New in pygame 1.8.