__init__(self,
value='C',
secs=0.5,
octave=4,
sampleRate=44100,
bits=16)
(Constructor)
| source code
|
value: can be a number, string or an array.
If it's a number between 37 and 32767 then a tone will be generated at
that frequency in Hz.
-----------------------------
It could be a string for a note ('A','Bfl','B','C','Csh'...)
- you may want to specify which octave as well
-----------------------------
Or a string could represent a filename in the current
location, or mediaLocation, or a full path combo
-----------------------------
Or by giving an Nx2 numpy array of floats (-1:1) you
can specify the sound yourself as a waveform
- secs: is only relevant if the value is a note name or
- a frequency value
- octave: is only relevant if the value is a note name.
- Middle octave of a piano is 4. Most computers won't
output sounds in the bottom octave (1) and the top
octave (8) is generally painful
- sampleRate(=44100): only used for sounds using pyglet. Pygame uses one rate for all sounds
- sample rate for all sounds (once initialised)
- bits(=16): Only 8- and 16-bits supported so far.
- Only used for sounds using pyglet. Pygame uses the same
sample rate for all sounds (once initialised)
- Parameters:
value, can, be, a, number, string, or, an, array, -
If it's a number between 37 and 32767 then a tone will be generated at that frequency in Hz.
It could be a string for a note ('A','Bfl','B','C','Csh'...). Then you may want to specify which octave as well
Or a string could represent a filename in the current location, or mediaLocation, or a full path combo
Or by giving an Nx2 numpy array of floats (-1:1) you can specify the sound yourself as a waveform
secs, is, only, relevant, if, the, value, is, a, note, name, or - a frequency value
octave, is, only, relevant, if, the, value, is, a, note, name. - Middle octave of a piano is 4. Most computers won't
output sounds in the bottom octave (1) and the top
octave (8) is generally painful
sampleRate(=44100), only, used, for, sounds, using, pyglet., Pygame, uses, one, rate, for, all, sounds - sample rate for all sounds (once initialised)
bits(=16), Only, 8-, and, 16-bits, supported, so, far. - Only used for sounds using pyglet. Pygame uses the same
sample rate for all sounds (once initialised)
- Overrides:
_SoundBase.__init__
|