Mercurial > pygame
diff src/sndarray.doc @ 627:18b5fa9180bf
new reference documentation system
| author | pygame |
|---|---|
| date | Mon, 03 Oct 2005 06:52:07 +0000 |
| parents | |
| children | 85f2ac863647 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/sndarray.doc Mon Oct 03 06:52:07 2005 +0000 @@ -0,0 +1,46 @@ +pygame.sndarray +pygame module for accessing sound sample data + +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 sample per second. Each sample is an 8bit +or 16bit integer, depending on the data format. A stereo sound file has two +values per sample, while mono sound only has one. + +Numeric does not use unsigned 16bit integers, they will be converted to +signed 16bit arrays. +<SECTION> + + + +array +copy Sound samples into an array +pygame.sndarray.array(Sound): return array + +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(). +<END> + + + +samples +reference Sound samples into an array +pygame.sndarray.samples(Sound): return array + +Creates a new Numeric array that direcetly 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(). +<END> + + + +make_sound +convert an array into a Sound object +pygame.sndarray.make_sound(array): return Sound + +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. +<END> +<END>
