4.1 audio -- An audio related services package

Availability: S60.

The audio module enables recording and playing audio files and access to device text-to-speech engine. The audio module supports all the formats supported by the device, typically: WAV, AMR, MIDI, MP3, AAC, and Real Audio4.1. For more information on the audio types supported by different devices, see the Forum Nokia Web site [5] and S60 Platform Web site [6].

The following Sound class static methods are defined in the audio module:

Sound.open( filename)

Returns a new initialized Sound object with the named file opened. Note that filename should be a full Unicode path name and must also include the file extension, for example u'c:\\foo.wav'.

The following data items for state information are available in audio:

ENotReady
The Sound object has been constructed but no audio file is open.

EOpen
An audio file is open but no playing or recording operation is in progress.

EPlaying
An audio file is playing.

ERecording
An audio file is being recorded.

The following data item is provided for continuous playback of an audio file:

KMdaRepeatForever
Possible value for times parameter in open.

The following method is available in the audio module:

say( text, prefix=audio.TTS_PREFIX)
Passes the text to the device text-to-speech engine. The default prefix is the text-to-speech prefix "(tts)".

text should be either Unicode or a UTF-8 encoded plain string. The speech synthesizer pronounces the text according to the current device language.



Footnotes

... Audio4.1
The dynamically loaded audio codec for the sound file is based on the MIME-type information inside the audio file and file extension.



Subsections
See About this document... for information on suggesting changes.