Sound objects have the following functions:
|[times=1, interval=0, callback=None])|
Starts playback of an audio file from the beginning. Without the parameters times and interval it plays the audio file one time. times defines the number of times the audio file is played, the default being 1. If the audio file is played several times, interval gives the time interval between the subsequent plays in microseconds.
The optional callback is called when the playing starts and when the end of the
sound file is reached. The callback should take three parameters: the previous
state, the current state and the possible error code. The possible states given
as parameters to the callback are data items in the module
play(audio.KMdaRepeatForever)will repeat the file forever.
stopneeds to be called explicitly prior to exit.
playto a second Sound instance while another audio file is playing, stops the earlier audio file and starts to play the second Sound instance.
playwhile a telephone call is ongoing plays the sound file to uplink. In some devices the sound file is also played to the device speaker.
playwhen already playing or recording results in
playwill prevent this from happening.
recordwhile a telephone call is ongoing starts the recording of the telephone call.
recordwhen already playing or recording results in
recordwill prevent this from happening.
Sets the volume. If the given volume is negative, then the volume is set to
zero which mutes the device. If the volume is greater than
max_volume is used.