A class implementing a tone stimulus.
Methods
Create a Tone.
Parameters : | duration : str
frequency : int, optional
samplerate : int, optional
bitdepth : int, optional
amplitude : int, optional
|
---|
Getter for amplitude.
Getter for bitdepth.
Copy the stimulus.
Returns : | copy: stimulus.Audio :
|
---|
Getter for duration.
Getter for filename
Getter for frequency.
Getter for id.
Getter for is_preloaded
Getter for logging.
Play the audio stimulus.
The function returns immediately after the sound started to play. A pygame.mixer.Channel object is returned.
Parameters : | loops : int, optional
maxtime : int
fade_ms : int, optional
|
---|
Preload stimulus to memory.
Presents the sound.
The function is identical to Audio.play(loops=0, maxtime=0, fade_ms=0) and returns also immediately after the sound started to play.
Notes
See Audio.play for more information.
Getter for samplerate.
Save the sine tone to a file.
Parameters : | filename : str
|
---|
Set logging of this object on or off
Parameters : | onoff : bool
|
---|
Notes
See also design.experiment.set_log_level fur further information about event logging.
Stop the audio stimulus
Unload stimulus from memory.
This removes the reference to the object in memory. It is up to the garbage collector to actually remove it from memory.