Location:
MdaAudioOutputStream.h
Link against: mediaclientaudiostream.lib
class CMdaAudioOutputStream : public CBase, public MMMFClientUtility;
The interface to an audio stream player passing raw audio data from specified buffers to the audio hardware.
This class enables MMF clients to:
Stream raw audio data to the audio hardware from specified buffers
Specify the priority of the audio stream in relation to other clients that may request to use the same audio hardware
Set the sample rate and the number of channels after successfully opening the stream. It is not possible to change these values once streaming has started.
Change the volume and balance before or while the stream is open for writing. Volume and balance settings take effect immediately.
The API supports callbacks from the server to notify the client:
MaoscOpenComplete() will be called when the audio streaming object is open and ready to stream data back to the audio hardware
as a result of a previous call to Open()
.
MaoscBufferCopied() Each time audio data has been successfully copied to the lower layers of the MMF as a result of a previous ReadL().
MaoscRecordComplete: When the audio data stream has been closed as a result of a previous Stop()
.
MMMFClientUtility
- No description.
CBase
- Base class for all classes to be instantiated on the heap
CMdaAudioOutputStream
- The interface to an audio stream player passing raw audio data from specified buffers to the audio hardware
Defined in CMdaAudioOutputStream
:
CancelRegisterAudioResourceNotification()
, CustomInterface()
, DataType()
, GetBalanceL()
, GetBytes()
, MaxVolume()
, NewL()
, NewL()
, Open()
, Position()
, RegisterAudioResourceNotification()
, SetAudioPropertiesL()
, SetBalanceL()
, SetDataTypeL()
, SetPriority()
, SetVolume()
, Stop()
, Volume()
, WillResumePlay()
, WriteL()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
static IMPORT_C CMdaAudioOutputStream *NewL(MMdaAudioOutputStreamCallback &aCallBack, CMdaServer *aServer=0);
Allocates and constructs an audio stream player object.
|
|
Capability: | MultimediaDD | A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD. |
static IMPORT_C CMdaAudioOutputStream *NewL(MMdaAudioOutputStreamCallback &aCallBack, TInt aPriority, TMdaPriorityPreference
aPref=EMdaPriorityPreferenceTimeAndQuality);
Constructs and initialises a new instance of an audio streaming object.
The function leaves if the audio streaming object cannot be created.
|
|
virtual void SetAudioPropertiesL(TInt aSampleRate, TInt aChannels);
Sets the sample rate and number of audio channels.
|
virtual void Open(TMdaPackage *aSettings);
Opens an output audio stream package.
The MMdaAudioOutputStreamCallback::MaosOpenComplete() callback function is called when the stream has been opened and is ready to receive audio data. If the open was unsuccessful, this is indicated by the aError parameter of the callback.
|
virtual TInt MaxVolume();
Returns the maximum volume level.
|
virtual TInt Volume();
Returns the current volume.
|
virtual void SetVolume(const TInt aNewVolume);
Sets the audio volume.
Set the volume to zero for "sound off" or any other value between 1 and MaxVolume()
.
|
Capability: | MultimediaDD | A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD. |
virtual void SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
Sets the audio priority values.
This function cannot be used while the stream object is open. It is intended for use before an Open()
is issued, or between a previous Stop()
and a new Open()
.
|
virtual void WriteL(const TDesC8 &aData);
Writes (plays) streaming raw audio data.
This function is asynchronous. When aData has been received, 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. MMdaAudioOutputStreamCallback::MaoscPlayComplete()
is called when all descriptors have been sent.
|
virtual const TTimeIntervalMicroSeconds &Position();
Returns the current position within the data stream.
|
IMPORT_C void SetBalanceL(TInt aBalance=KMMFBalanceCenter);
Sets the audio balance.
|
IMPORT_C TInt GetBalanceL() const;
Returns the current balance as an integer.
|
IMPORT_C TInt GetBytes();
Returns the current number of bytes rendered by audio hardware.
|
IMPORT_C void SetDataTypeL(TFourCC aAudioType);
Sets the data type. If the data type is not explicitly set it will assumed to be pcm16. If it is set then the hardware must support the data type being set otherwise the function leaves with KErrNotSupported.
|
|
IMPORT_C TFourCC DataType() const;
Returns the current data type.
|
IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &aCallback, TUid aNotificationEventUid,
const TDesC8 &aNotificationRegistrationData=KNullDesC8);
Registers the Event for Notification when resource is avaliable.
|
|
IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
Cancels the registered notification event.
|
|
IMPORT_C TInt WillResumePlay();
Waits for the client to resume the play even after the default timer expires.
|
IMPORT_C TAny *CustomInterface(TUid aInterfaceId);
Retrieves a custom interface to the underlying device.
|
|