Location:
MdaAudioSamplePlayer.h
Link against: MediaClientAudio.lib
CMdaAudioPlayerUtility
Supported from 5.0
Plays sampled audio data.
The class offers a simple interface to open, play and obtain information from, sampled audio data. The audio data can supplied either in a file (file-based) or as a descriptor (descriptor-based).
While this class is abstract, the three static functions construct, initialise and return pointers to instances of concrete classes derived from this abstract class. This concrete class is part of the Media Server implementation and is private.
|
Defined in CMdaAudioPlayerUtility
:
Duration()
, MaxVolume()
, NewDesPlayerL()
, NewDesPlayerReadOnlyL()
, NewFilePlayerL()
, Play()
, SetRepeats()
, SetVolume()
, SetVolumeRamp()
, Stop()
Inherited from CBase
:
operator new()
static CMdaAudioPlayerUtility* NewFilePlayerL(const TDesC& aFileName, MMdaAudioPlayerCallback& aCallback, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);
Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a file. The audio data must be in a supported format (e.g. WAV and AU).
The function leaves if the audio player utility object cannot be created.
When initialisation of the audio player utility is complete,
successfully or otherwise, the callback function
MMdaAudioPlayerCallback::MapcInitComplete()
is
called.
|
|
static CMdaAudioPlayerUtility* NewDesPlayerL(TDes8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);
Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a descriptor. The audio data must be in a supported format (e.g. WAV and AU).
The function leaves if the audio player utility object cannot be created.
When initialisation of the audio player utility is complete,
successfully or otherwise, the callback function
MMdaAudioPlayerCallback::MapcInitComplete()
is
called.
|
|
static CMdaAudioPlayerUtility* NewDesPlayerReadOnlyL(const TDesC8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);
Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a read only descriptor. The audio data must be in a supported format (e.g. WAV and AU).
The function leaves if the audio player utility object cannot be created.
When initialisation of the audio player utility is complete,
successfully or otherwise, the callback function
MMdaAudioPlayerCallback::MapcInitComplete()
is
called.
|
|
virtual void Play() = 0;
Begins playback of the initialised audio sample at the current volume and priority levels.
When playing of the audio sample is complete, successfully or
otherwise, the callback function
MMdaAudioPlayerCallback::MapcPlayComplete()
is called.
This function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.
virtual void SetVolume(TInt aVolume) = 0;
Changes the current playback volume to a specified value.
The volume can be changed before or during playback and is effective immediately.
The function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.
|
virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence) = 0;
Sets the number of times the audio sample is to be repeated during the playback operation.
A period of silence can follow each playing of the sample. The audio sample can be repeated indefinitely.
|
virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
Defines the period over which the volume level is to rise smoothly from nothing to the normal volume level.
|
virtual void Stop() = 0;
Stops playback of the audio sample as soon as possible.
If the audio sample is playing, playback is stopped as soon as possible. If playback is already complete, nothing further happens as a result of calling this function.
The callback function
MMdaAudioPlayerCallback::MapcPlayComplete()
is not called.
The function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.
virtual const TTimeIntervalMicroSeconds& Duration() = 0;
Returns the duration of the audio sample.
The function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.
|
virtual TInt MaxVolume() = 0;
Returns an integer representing the maximum volume. This is
the maximum value which can be passed to
CMdaAudioPlayerUtility::SetVolume()
.
The function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.
|