Location:
mdaaudiooutputstream.h
Link against: mediaclientaudiostream.lib
CMdaAudioOutputStream
Supported from 6.1
The interface to an audio stream player.
The class is abstract with a static factory function that returns an instance of a concrete derived class. The concrete derived class is not visible to the user.
This class allows media server clients to:
stream audio data to the media server
change the sample rate, the number of channels and the volume when opening a stream and after having opened a stream
change the volume whilst a stream is open
The API supports callbacks from the server to notify the client:
when the audio streaming object in the server has been opened, so that streaming can begin
each time a descriptor containing sound data has been copied to the server
when all data has been sent to the server
|
Defined in CMdaAudioOutputStream
:
MaxVolume()
, NewL()
, Open()
, Position()
, SetAudioPropertiesL()
, SetPriority()
, SetVolume()
, Stop()
, Volume()
, WriteL()
Inherited from CBase
:
operator new()
static CMdaAudioOutputStream* NewL(MMdaAudioOutputStreamCallback& aCallBack,CMdaServer* aServer=NULL);
Static factory function that allocates and constructs an audio stream player and, if necessary, connects to the media server.
|
|
Open()
must be called.virtual void SetAudioPropertiesL(TInt aSampleRate, TInt aChannels) = 0;
Changes the sample rate and number of channels.
Writing to the stream must have stopped before you call this function.
|
|
|
virtual void SetPriority(TInt aPriority, TMdaPriorityPreference aPref) = 0;
Sets the client's priority.
This is used to resolve conflicts when more than one client tries to access the sound output device at the same time.
|
|
EMdaPriorityNormal
.TMdaPriority
virtual TInt MaxVolume() = 0;
Gets the audio stream player's maximum volume.
This is the maximum value that can be passed to
SetVolume()
.
|
virtual TInt Volume() = 0;
Gets the audio stream player's current volume.
The volume is initialised by the server when
Open()
is called. The client can then change it by calling
SetVolume()
.
|
|
virtual void SetVolume(const TInt aNewVolume) = 0;
Changes the volume.
This can be called before or during playback.
|
|
virtual void Open(TMdaPackage* aSettings) = 0;
Opens the audio output stream.
This function must be called before the stream player can be
used. The stream is opened asynchronously, using an active object. On
completion, MMdaAudioOutputStreamCallback::MaoscOpenComplete()
is
called.
|
|
virtual void WriteL(const TDesC8& aData) = 0;
Writes data to the audio output stream, via the media server.
This function is asynchronous. When aData
has
been received by the server, the client is notified by a call to
MMdaAudioOutputStreamCallback::MaoscBufferCopied()
. The client can
call WriteL()
again before this notification takes place because
the buffers are maintained in a client-side queue until they have been sent. An
active object performs the notification, and copies the next item in the queue
to the server. MaoscPlayComplete()
is called when all descriptors
have been sent.
|
|
virtual const TTimeIntervalMicroSeconds& Position() = 0;
Gets the current position in the stream.
This is the amount of time the stream has been playing sound, as a microseconds time interval.
|
|
virtual void Stop() = 0;
Ends audio playback.
The function has no effect if the stream is open but playback is not taking place.
Any descriptors in the queue are discarded and
MMdaAudioOutputStreamCallback::MaoscBufferCopied()
is called with
the address of the last descriptor sent and an error value of
KErrAbort
.
|