|
||
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 CMdaAudioOutputStream::Open(TMdaPackage *)
.
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 CMdaAudioOutputStream::Stop()
.
MMMFClientUtility
- No description.
CBase
-
Base class for all classes to be instantiated on the heap.
CMdaAudioOutputStream
- ...
Defined in CMdaAudioOutputStream
:
CancelRegisterAudioResourceNotification(TUid)
Cancels the registered notification event. CustomInterface(TUid)
Retrieves a custom interface to the underlying device.DataType()const
Returns the current data type.GetBalanceL()const
Returns the current balance as an integer.GetBytes()
Returns the current number of bytes rendered by audio hardware.MaxVolume()
Returns the maximum volume level.NewL(MMdaAudioOutputStreamCallback &,CMdaServer *)
Allocates and constructs an audio stream player object.NewL(MMdaAudioOutputStreamCallback &,TInt,TMdaPriorityPreference)
Constructs and initialises a new instance of an audio streaming object.Open(TMdaPackage *)
Opens an output audio stream package.Position()
Returns the current position within the data stream.RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &,TUid,const TDesC8 &)
Registers the Event for Notification when resource is avaliable. SetAudioPropertiesL(TInt,TInt)
Sets the sample rate and number of audio channels.SetBalanceL(TInt)
Sets the audio balance.SetDataTypeL(TFourCC)
Sets the data type. If the data type is not explicitly set it will assumed to be...SetPriority(TInt,TMdaPriorityPreference)
Sets the audio priority values.SetVolume(const TInt)
Sets the audio volume.Stop()
Stops writing data to a stream.Volume()
Returns the current volume.WillResumePlay()
Waits for the client to resume the play even after the default timer expires. WriteL(const TDesC8 &)
Writes (plays) streaming raw audio data.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C static 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. |
IMPORT_C static 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 CMdaAudioOutputStream::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 CMdaAudioOutputStream::Open(TMdaPackage *)
is issued, or between a previous CMdaAudioOutputStream::Stop()
and a new CMdaAudioOutputStream::Open(TMdaPackage *)
.
|
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(TInt,const TDesC8 &)
. The client can call CMdaAudioOutputStream::WriteL(const TDesC8 &)
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(TInt)
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.
|
|