CMdaAudioRecorderUtility Class Reference

#include <mdaaudiosampleeditor.h>

Link against: mediaclientaudio.lib

class CMdaAudioRecorderUtility : public CMdaAudioClipUtility

Inherits from

Public Member Enumerations
enumTDeviceMode { EDefault, ETelephonyOrLocal, ETelephonyMixed, ETelephonyNonMixed, ELocal }
Public Member Functions
virtual ~CMdaAudioRecorderUtility()
IMPORT_C voidAddMetaDataEntryL(CMMFMetaDataEntry &)
IMPORT_C const CMMFControllerImplementationInformation &AudioPlayControllerImplementationInformationL()
IMPORT_C const CMMFControllerImplementationInformation &AudioRecorderControllerImplementationInformationL()
IMPORT_C TIntCancelRegisterAudioResourceNotification(TUid)
virtual voidClearPlayWindow()
virtual voidClose()
virtual voidCropFromBeginningL()
virtual voidCropL()
IMPORT_C TUintDestinationBitRateL()
IMPORT_C TFourCCDestinationDataTypeL()
IMPORT_C TUidDestinationFormatL()
IMPORT_C TUintDestinationNumberOfChannelsL()
IMPORT_C TUintDestinationSampleRateL()
virtual const TTimeIntervalMicroSeconds &Duration()
IMPORT_C TMMFDurationInfoDuration(TTimeIntervalMicroSeconds &)
IMPORT_C voidGetAudioLoadingProgressL(TInt &)
IMPORT_C MMMFDRMCustomCommand *GetDRMCustomCommand()
IMPORT_C TIntGetGain(TInt &)
IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TInt)
IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &)
IMPORT_C TIntGetPlaybackBalance(TInt &)
IMPORT_C TIntGetRecordBalance(TInt &)
IMPORT_C voidGetSupportedBitRatesL(RArray< TUint > &)
IMPORT_C voidGetSupportedDestinationDataTypesL(RArray< TFourCC > &)
IMPORT_C voidGetSupportedNumberOfChannelsL(RArray< TUint > &)
IMPORT_C voidGetSupportedSampleRatesL(RArray< TUint > &)
IMPORT_C TIntGetVolume(TInt &)
virtual TInt MaxGain()
virtual TInt MaxVolume()
IMPORT_C CMdaAudioRecorderUtility *NewL(MMdaObjectStateChangeObserver &, CMdaServer *, TInt, TInt)
virtual voidOpenDesL(const TDesC8 &)
IMPORT_C voidOpenDesL(TDes8 &)
IMPORT_C voidOpenDesL(TDes8 &, TUid, TUid, TUid, TFourCC)
virtual voidOpenFileL(const TDesC &)
IMPORT_C voidOpenFileL(const RFile &)
IMPORT_C voidOpenFileL(const TMMSource &)
IMPORT_C voidOpenFileL(const TDesC &, TUid, TUid, TUid, TFourCC)
IMPORT_C voidOpenFileL(const RFile &, TUid, TUid, TUid, TFourCC)
IMPORT_C voidOpenFileL(const TMMSource &, TUid, TUid, TUid, TFourCC)
virtual voidOpenL(TMdaClipLocation *, TMdaClipFormat *, TMdaPackage *, TMdaPackage *)
IMPORT_C voidOpenUrlL(const TDesC &, TInt, TUid, TUid, TUid, TFourCC)
IMPORT_C voidOpenUrlL(const TDesC &, TInt, const TDesC8 &)
IMPORT_C voidPlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidPlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntPlayControllerCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TIntPlayControllerCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)
virtual voidPlayL()
virtual const TTimeIntervalMicroSeconds &Position()
IMPORT_C voidRecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidRecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntRecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TIntRecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)
virtual voidRecordL()
virtual const TTimeIntervalMicroSeconds &RecordTimeAvailable()
IMPORT_C TIntRegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &, TUid, const TDesC8 &)
IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &)
IMPORT_C TIntRemoveMetaDataEntry(TInt)
IMPORT_C voidReplaceMetaDataEntryL(TInt, CMMFMetaDataEntry &)
virtual voidSetAudioDeviceMode(TDeviceMode)
IMPORT_C voidSetDestinationBitRateL(TUint)
IMPORT_C voidSetDestinationDataTypeL(TFourCC)
IMPORT_C voidSetDestinationFormatL(TUid)
IMPORT_C voidSetDestinationNumberOfChannelsL(TUint)
IMPORT_C voidSetDestinationSampleRateL(TUint)
virtual voidSetGain(TInt)
virtual voidSetMaxWriteLength(TInt)
virtual voidSetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetPlaybackBalance(TInt)
virtual voidSetPosition(const TTimeIntervalMicroSeconds &)
IMPORT_C voidSetPriority(TInt, TInt)
IMPORT_C TIntSetRecordBalance(TInt)
virtual voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetThreadPriorityPlayback(const TThreadPriority &)
IMPORT_C TIntSetThreadPriorityRecord(const TThreadPriority &)
virtual TInt SetVolume(TInt)
virtual voidSetVolumeRamp(const TTimeIntervalMicroSeconds &)
IMPORT_C TUintSourceBitRateL()
virtual TState State()
virtual voidStop()
IMPORT_C voidUseSharedHeap()
IMPORT_C TIntWillResumePlay()
Inherited Enumerations
CMdaAudioClipUtility:TState
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CMdaAudioClipUtility::ClipUtil_Reserved3()
CMdaAudioClipUtility::ClipUtil_Reserved4()
CMdaAudioClipUtility::TypeL()

Detailed Description

Plays back, records and edits audio sample data.

The class offers an interface to play, record and edit audio sample data. This data can be supplied either in a file or as a descriptor. The functions that start and stop playback and recording are defined in the base class CMdaAudioClipUtility.

While this class is abstract, the static NewL() function constructs, initialises and returns a pointer to an instance of a concrete class derived from this abstract class. This concrete class is part of the MMF implementation and is private.

Member Enumeration Documentation

Enum TDeviceMode

Device mode. Used by SetAudioDeviceMode method which is not used from 7.0s
Since
5.0
EnumeratorValueDescription
EDefault0

The default behaviour.

When recording: If a telephony call is in progress, an attempt is made to connect to the telephony downlink plus the device microphone. If there is no telephony call in progress or a connection to the telephony downlink fails, an attempt is made to connect to the device microphone only.

When playing: If a telephony call is in progress, an attempt is made to connect to the telephony uplink. If there is no telephony call in progress or a connection to the telephony uplink fails, an attempt is made to connect to the device speaker.

ETelephonyOrLocalEDefault

See EDefault.

ETelephonyMixed1

When recording: If a telephony call is in progress the audio source is the telephony downlink mixed with the device microphone. If there is no telephony call in progress or a connection to the telephony downlink fails, no attempt is made to connect to the microphone.

When playing: If a telephony call is in progress the audio sample data is played to the telephony uplink and the device speaker. If there is no telephony call in progress or a connection to the telephony uplink fails, no attempt is made to connect to the device speaker.

ETelephonyNonMixed2

When recording, the audio source is the telephony downlink and is not mixed with the device microphone.

When playing, the audio sample data is played to the telephony uplink and is not mixed with the device speaker.

ELocal3

When recording, the audio source is the device microphone.

When playing, the audio sample data is played to the device speaker.

Constructor & Destructor Documentation

~CMdaAudioRecorderUtility ( )

~CMdaAudioRecorderUtility()[virtual]

Destructor. Closes the audio clip and frees resources.

Since
5.0

Member Function Documentation

AddMetaDataEntryL ( CMMFMetaDataEntry & )

IMPORT_C voidAddMetaDataEntryL(CMMFMetaDataEntry &aMetaDataEntry)

Adds a meta data entry to the audio clip.

Since
7.0s
ParameterDescription
aMetaDataEntryThe new meta data entry to add to the clip.

AudioPlayControllerImplementationInformationL ( )

IMPORT_C const CMMFControllerImplementationInformation &AudioPlayControllerImplementationInformationL()

Returns the controller implementation information associated with the playback controller

Since
7.0s

Returns: The controller implementation structure associated with the controller

AudioRecorderControllerImplementationInformationL ( )

IMPORT_C const CMMFControllerImplementationInformation &AudioRecorderControllerImplementationInformationL()

Returns the controller implementation information associated with the recording controller.

Since
7.0s

Returns: The controller implementation structure associated with the controller

CancelRegisterAudioResourceNotification ( TUid )

IMPORT_C TIntCancelRegisterAudioResourceNotification(TUidaNotificationEventId)

Cancels the registered notification event.

ParameterDescription
aNotificationEventIdThe Event to notify the client.

Returns: An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.

ClearPlayWindow ( )

voidClearPlayWindow()[virtual]

Reimplemented from CMdaAudioClipUtility::ClearPlayWindow()

Removes any window defined on the audio sample data.

All subsequent playing, position setting and position querying requests are mapped to the whole of the audio sample data.

Since
5.0

Close ( )

voidClose()[virtual]

Reimplemented from CMdaAudioClipUtility::Close()

Close the current audio clip.

Since
5.0

CropFromBeginningL ( )

voidCropFromBeginningL()[virtual]

Reimplemented from CMdaAudioClipUtility::CropFromBeginningL()

Deletes all audio sample data from the beginning of the audio clip to the current position. The effects of the function cannot be undone.

The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.

Since
7.0s

CropL ( )

voidCropL()[virtual]

Reimplemented from CMdaAudioClipUtility::CropL()

Deletes all audio sample data after the current head position. The effects of the function cannot be undone.

The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.

Since
5.0

DestinationBitRateL ( )

IMPORT_C TUintDestinationBitRateL()

Returns the bit rate in bits per second that the data sink is currently set to.

Since
7.0s

Returns: Bit rate of data sink in bits/second.

DestinationDataTypeL ( )

IMPORT_C TFourCCDestinationDataTypeL()

Returns the codec that is currently set for the destination audio clip.

Since
7.0s

Returns: Four character code, representing the codec of the destination audio clip.

DestinationFormatL ( )

IMPORT_C TUidDestinationFormatL()

Returns the format(UID) of the destination audio clip.

Since
7.0s

Returns: UID of the audio clip format.

DestinationNumberOfChannelsL ( )

IMPORT_C TUintDestinationNumberOfChannelsL()

Returns the number of channels that the destination audio clip is currently configured to support.

Since
7.0s

Returns: The number of channels supported by audio clip

DestinationSampleRateL ( )

IMPORT_C TUintDestinationSampleRateL()

Returns the sample rate in samples/second that the destination data sink is currently set to.

Since
7.0s

Returns: The sample rate of the conversion destination

Duration ( )

const TTimeIntervalMicroSeconds &Duration()[virtual]

Reimplemented from CMdaAudioClipUtility::Duration()

Returns the duration of the audio clip.

Since
5.0

Returns: The duration in microseconds.

Duration ( TTimeIntervalMicroSeconds & )

IMPORT_C TMMFDurationInfoDuration(TTimeIntervalMicroSeconds &aDuration)

Returns the duration of the audio sample in microseconds, and the duration state.

The function raises a CMdaAudioPlayerUtility 1 panic if the audio player utility is not initialised.

Since
9.1
ParameterDescription
aDurationThe duration of the sample in microseconds.

Returns: The duration state

GetAudioLoadingProgressL ( TInt & )

IMPORT_C voidGetAudioLoadingProgressL(TInt &aPercentageComplete)

Returns the current progress of audio loading.

Since
7.0s
ParameterDescription
aPercentageCompleteThe percentage of the audio clip loaded.

GetDRMCustomCommand ( )

IMPORT_C MMMFDRMCustomCommand *GetDRMCustomCommand()

Gets a controller's DRM custom command implementation.

Returns: A pointer to a controller's DRM custom command implementation, or NULL if the controller does not support it.

GetGain ( TInt & )

IMPORT_C TIntGetGain(TInt &aGain)

Returns the current gain setting of the audio device.

Since
7.0s
ParameterDescription
aGainOn return contains the current gain setting for the audio device. Can be any value between zero and MaxGain().

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetMetaDataEntryL ( TInt )

IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TIntaMetaDataIndex)

Returns the specified meta data entry from the current audio clip.

Since
7.0s
ParameterDescription
aMetaDataIndexThe index of the entry to retrieve. The index is between 0 and GetNumberOfMetaDataEntries()-1

Returns: The meta data entry requested

GetNumberOfMetaDataEntries ( TInt & )

IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &aNumEntries)

Returns the number of meta data entries associated with this clip.

Since
7.0s
ParameterDescription
aNumEntriesOn return contains the number of meta data entries.

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetPlaybackBalance ( TInt & )

IMPORT_C TIntGetPlaybackBalance(TInt &aBalance)

Returns The current balance setting for the audio device. This function may not return the same value as passed to SetPlaybackBalance depending on the internal implementation in the underlying components.

Since
7.0s
ParameterDescription
aBalanceThe playback balance, between KMMFBalanceMaxLeft and KMMFBalanceMaxRight

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetRecordBalance ( TInt & )

IMPORT_C TIntGetRecordBalance(TInt &aBalance)

Returns the current recording balance setting between the left and right stereo microphones.

Since
7.0s
ParameterDescription
aBalanceOn return, contains the current recording balance between KMMFBalanceMaxLeft and KMMFBalanceMaxRight

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetSupportedBitRatesL ( RArray< TUint > & )

IMPORT_C voidGetSupportedBitRatesL(RArray< TUint > &aSupportedBitRates)

Returns a list of the supported bit rates for recording to the data sink.

Since
7.0s
ParameterDescription
aSupportedBitRatesList of bit rates supported for the data sink destination.

GetSupportedDestinationDataTypesL ( RArray< TFourCC > & )

IMPORT_C voidGetSupportedDestinationDataTypesL(RArray< TFourCC > &aSupportedDataTypes)

Returns a list of the supported codecs for the conversion destination.

Since
7.0s
ParameterDescription
aSupportedDataTypesList of four character codes, representing supported data codecs for the conversion destination.

GetSupportedNumberOfChannelsL ( RArray< TUint > & )

IMPORT_C voidGetSupportedNumberOfChannelsL(RArray< TUint > &aSupportedNumChannels)

Returns a list of the supported number of channels for recording. For example 1 for mono, 2 for stereo and so on.

Since
7.0s
ParameterDescription
aSupportedNumChannelsOn return, contains a list of the number of channels supported for recording

GetSupportedSampleRatesL ( RArray< TUint > & )

IMPORT_C voidGetSupportedSampleRatesL(RArray< TUint > &aSupportedSampleRates)

If a destination sample rate has not been set then GetSupportedSampleRatesL() returns all valid sample rates

If a destination sample rate has been set then GetSupportedSampleRatesL() returns all valid sample rates less than or equal to the destination sample rate

Since
7.0s
ParameterDescription
aSupportedSampleRatesOn return, contains a list of the sample rates that are supported for recording.

GetVolume ( TInt & )

IMPORT_C TIntGetVolume(TInt &aVolume)

Returns the current volume setting for the audio device.

Since
7.0s
ParameterDescription
aVolumeOn return contains the current volume setting of the audio device. Can be any value between zero and MaxVolume().

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

MaxGain ( )

TInt MaxGain()[virtual]

Return the maximum value for the gain

Since
5.0

Returns: The maximum gain. For devices where automatic gain control is used, this value may be zero.

MaxVolume ( )

TInt MaxVolume()[virtual]

Returns the maximum volume setting for the audio device.

Since
5.0

Returns: The maximum volume. This value is platform dependent but is always greater than or equal to one.

NewL ( MMdaObjectStateChangeObserver &, CMdaServer *, TInt, TInt )

IMPORT_C CMdaAudioRecorderUtility *NewL(MMdaObjectStateChangeObserver &aObserver,
CMdaServer *aServer = NULL,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality
)[static]

Constructs and initialises a new instance of the audio recorder for playing, recording and editing audio sample data.

The function leaves if the audio recorder object cannot be created.

Since
5.0
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.
ParameterDescription
aObserverClass to receive state change events from recorder
aServerNo longer used, should be NULL
aPriorityThe Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
aPrefThe Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.

Returns: A pointer to the new audio recorder object

OpenDesL ( const TDesC8 & )

voidOpenDesL(const TDesC8 &aDescriptor)[virtual]

Opens a descriptor to play back or record audio sample data (const version).

Since
5.0
ParameterDescription
aDescriptorThe descriptor which is a source of existing audio sample data. This descriptor must remain in existence for the lifetime of this audio clip recorder object.

OpenDesL ( TDes8 & )

IMPORT_C voidOpenDesL(TDes8 &aDescriptor)

Opens a descriptor to play back or record audio sample data.

Since
7.0s
ParameterDescription
aDescriptorThe descriptor which is a source of existing audio sample data. This descriptor must remain in existence for the lifetime of this audio clip recorder object.

OpenDesL ( TDes8 &, TUid, TUid, TUid, TFourCC )

IMPORT_C voidOpenDesL(TDes8 &aDescriptor,
TUidaRecordControllerUid,
TUidaPlaybackControllerUid = KNullUid,
TUidaDestinationFormatUid = KNullUid,
TFourCCaDestinationDataType =  KFourCCNULL
)

Opens an audio clip from a descriptor to play back existing audio data from or to record new audio data to.

Since
7.0s
ParameterDescription
aDescriptorThe descriptor that contains or will contain the audio data.
aRecordControllerUidThe UID of the controller to use for recording.
aPlaybackControllerUidThe UID of the controller to use for playback. If KNullUid is used then the same controller is used for playback and recording.
aDestinationFormatUidThe UID of the audio record format
aDestinationDataTypeData type for recording.

OpenFileL ( const TDesC & )

voidOpenFileL(const TDesC &aFileName)[virtual]

Opens a file to play back or record audio sample data.

Since
5.0
ParameterDescription
aFileNameThe full path and filename of the file which is a source of existing audio sample data.

OpenFileL ( const RFile & )

IMPORT_C voidOpenFileL(const RFile &aFile)

Opens a file to play back or record audio sample data.

ParameterDescription
aFileThe full path and filename of the file which is a source of existing audio sample data.

OpenFileL ( const TMMSource & )

IMPORT_C voidOpenFileL(const TMMSource &aSource)

Opens a file to play or record audio sample data.

OpenFileL ( const TDesC &, TUid, TUid, TUid, TFourCC )

IMPORT_C voidOpenFileL(const TDesC &aFileName,
TUidaRecordControllerUid,
TUidaPlaybackControllerUid = KNullUid,
TUidaDestinationFormatUid = KNullUid,
TFourCCaDestinationDataType =  KFourCCNULL
)

Opens an audio clip from a file to play back existing audio data or to record new audio data.

Since
7.0s
ParameterDescription
aFileNameThe full path and filename of the file that contains or will contain the audio data.
aRecordControllerUidThe UID of the controller to use for recording.
aPlaybackControllerUidThe UID of the controller to use for playback. If KNullUid is used the same controller is used for playback and recording.
aDestinationFormatUidThe UID of record audio format.
aDestinationDataTypeData type for recording

OpenFileL ( const RFile &, TUid, TUid, TUid, TFourCC )

IMPORT_C voidOpenFileL(const RFile &aFile,
TUidaRecordControllerUid,
TUidaPlaybackControllerUid = KNullUid,
TUidaDestinationFormatUid = KNullUid,
TFourCCaDestinationDataType =  KFourCCNULL
)

Opens an audio clip from a file to play back existing audio data or to record new audio data.

ParameterDescription
aFileThe full path and filename of the file that contains or will contain the audio data.
aRecordControllerUidThe UID of the controller to use for recording.
aPlaybackControllerUidThe UID of the controller to use for playback. If KNullUid is used the same controller is used for playback and recording.
aDestinationFormatUidThe UID of record audio format.
aDestinationDataTypeData type for recording

OpenFileL ( const TMMSource &, TUid, TUid, TUid, TFourCC )

IMPORT_C voidOpenFileL(const TMMSource &aSource,
TUidaRecordControllerUid,
TUidaPlaybackControllerUid = KNullUid,
TUidaDestinationFormatUid = KNullUid,
TFourCCaDestinationDataType =  KFourCCNULL
)

Opens an audio clip from a filename or an open file handle to play back existing audio data or to record new audio data.

ParameterDescription
aSourceThe full path and filename of the file or a fiule handle that contains or will contain the audio data.
aRecordControllerUidThe UID of the controller to use for recording.
aPlaybackControllerUidThe UID of the controller to use for playback. If KNullUid is used the same controller is used for playback and recording.
aDestinationFormatUidThe UID of record audio format.
aDestinationDataTypeData type for recording

OpenL ( TMdaClipLocation *, TMdaClipFormat *, TMdaPackage *, TMdaPackage * )

voidOpenL(TMdaClipLocation *aLocation,
TMdaClipFormat *aFormat,
TMdaPackage *aArg1 = NULL,
TMdaPackage *aArg2 = NULL
)[virtual]

Opens a TMdaClipLocation package of audio data that can be played back or recorded to.

Since
5.0
ParameterDescription
aLocationThe location of a source of existing audio sample data or a target for new audio sample data. This is normally a file name (a TMdaFileClipLocation) or a descriptor (a TMdaDesClipLocation).
aFormatThe format of the audio clip.
aArg1The codec/data type to use.
aArg2The audio settings

OpenUrlL ( const TDesC &, TInt, TUid, TUid, TUid, TFourCC )

IMPORT_C voidOpenUrlL(const TDesC &aUrl,
TIntaIapId,
TUidaRecordControllerUid,
TUidaPlaybackControllerUid = KNullUid,
TUidaDestinationFormatUid = KNullUid,
TFourCCaDestinationDataType =  KFourCCNULL
)

Opens an audio clip from a URL to play back existing audio data from or to record new audio data to.

Since
7.0s
ParameterDescription
aUrlThe URL that contains or will contain the audio data.
aIapIdThe ID of the internet access point to use. KUseDefaultIap selects the default Internet access point.
aRecordControllerUidThe UID of the controller to use for recording.
aPlaybackControllerUidThe UID of the controller to use for playback. If KNullUid is used then the same controller is used for playback and recording.
aDestinationFormatUidThe UID of the audio record format.
aDestinationDataTypeData type for recording.

OpenUrlL ( const TDesC &, TInt, const TDesC8 & )

IMPORT_C voidOpenUrlL(const TDesC &aUrl,
TIntaIapId =  KUseDefaultIap ,
const TDesC8 &aMimeType =  KNullDesC8
)

Opens an audio clip from a URL to play back or record audio sample data.

Since
7.0s
ParameterDescription
aUrlThe URL that contains or will contain the audio data.
aIapIdThe ID of the internet access point to use. KUseDefaultIap selects the default Internet access point.
aMimeTypeThe MIME type of the data pointed to by aUrl.

PlayControllerCustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus & )

IMPORT_C voidPlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom,
TRequestStatus &aStatus
)

Send a asynchronous custom command to the recording controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.
Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

PlayControllerCustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus & )

IMPORT_C voidPlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TRequestStatus &aStatus
)

Send a asynchronous custom command to the recording controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

PlayControllerCustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 & )

IMPORT_C TIntPlayControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom
)

Send a synchronous custom command to the playback controller

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.

Returns: The result of the request. Exact range of values is dependent on the interface.

PlayControllerCustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntPlayControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2
)

Send a synchronous custom command to the playback controller.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

Returns: The result of the request. Exact range of values is dependent on the interface.

PlayL ( )

voidPlayL()[virtual]

Begins playback of audio sample data at the current playback position using the current volume, gain and priority settings.

Since
5.0

Position ( )

const TTimeIntervalMicroSeconds &Position()[virtual]

Returns the current head position.

The head position is defined in terms of a time interval measured from the beginning of the audio sample data.

Since
5.0

Returns: The current position in the audio clip, in microseconds.

RecordControllerCustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus & )

IMPORT_C voidRecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom,
TRequestStatus &aStatus
)

Send a asynchronous custom command to the recording controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

RecordControllerCustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus & )

IMPORT_C voidRecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TRequestStatus &aStatus
)

Send a asynchronous custom command to the recording controller

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

RecordControllerCustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 & )

IMPORT_C TIntRecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom
)

Sends a synchronous custom command to the recording controller.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.

Returns: The result of the request. Exact range of values is dependent on the interface.

RecordControllerCustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntRecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2
)

Sends a synchronous custom command to the recording controller.

Since
7.0s
ParameterDescription
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.

Returns: The result of the request. Exact range of values is dependent on the interface.

RecordL ( )

voidRecordL()[virtual]

Starts appending new audio sample data.

The new audio sample data is appended to the existing audio sample data in the same format as the existing audio sample data. If existing data is to be overwritten, then it should be cropped to the appropriate length before appending the new data.

Note: Before starting to record, make sure that the gain is set by calling SetGain(), as the initial gain is undefined. The gain might also have been modified by another client application.

Since
5.0
capability
UserEnvironment For recording - the requesting client process must have the UserEnvironment capability.

RecordTimeAvailable ( )

const TTimeIntervalMicroSeconds &RecordTimeAvailable()[virtual]

Returns the recording time available for the selected file or descriptor and encoding format.

Since
5.0

Returns: The recording time available measured in microseconds.

RegisterAudioResourceNotification ( MMMFAudioResourceNotificationCallback &, TUid, const TDesC8 & )

IMPORT_C TIntRegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &aCallback,
TUidaNotificationEventUid,
const TDesC8 &aNotificationRegistrationData =  KNullDesC8
)

Registers the Event for Notification when resource is avaliable.

ParameterDescription
aCallbackThe audio outputstream observer interface..
aNotificationEventUidThe Event for which the client is registered.
aNotificationRegistrationDataNotification registration specific data.

Returns: An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.

RegisterForAudioLoadingNotification ( MAudioLoadingObserver & )

IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &aCallback)

Register to receive notifications of audio loading/rebuffering

Since
7.0s
ParameterDescription
aCallbackThe object to receive audio loading notifications.

RemoveMetaDataEntry ( TInt )

IMPORT_C TIntRemoveMetaDataEntry(TIntaMetaDataIndex)

Removes a specified meta data entry from the audio clip.

Since
7.0s
ParameterDescription
aMetaDataIndexThe index of the meta data entry to remove.

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

ReplaceMetaDataEntryL ( TInt, CMMFMetaDataEntry & )

IMPORT_C voidReplaceMetaDataEntryL(TIntaMetaDataIndex,
CMMFMetaDataEntry &aMetaDataEntry
)

Replaces the specified meta data entry with a new entry.

Since
7.0s
ParameterDescription
aMetaDataIndexThe index of the meta data entry to replace.
aMetaDataEntryThe new meta data entry to replace the one pointed to by aMetaDataIndex.

SetAudioDeviceMode ( TDeviceMode )

voidSetAudioDeviceMode(TDeviceModeaMode)[virtual]

Sets the audio device mode. This function is provided for binary compatibility, but does not have any effect from 7.0s.

Since
5.0
ParameterDescription
aModeOne of the TDeviceMode settings

SetDestinationBitRateL ( TUint )

IMPORT_C voidSetDestinationBitRateL(TUintaBitRate)

Sets the bit rate of the data sink in bits per second.

The bit rate must be one of the supported bit rates of the data sink. Use GetSupportedBitRatesL() to retrieve a list of supported bit rates for the data sink.

Since
7.0s
ParameterDescription
aBitRateDestination bit rate in bits/second.

SetDestinationDataTypeL ( TFourCC )

IMPORT_C voidSetDestinationDataTypeL(TFourCCaDataType)

Sets the codec to use with the record controller.

Since
7.0s
ParameterDescription
aDataTypeFour character code, representing the codec of the destination audio clip

SetDestinationFormatL ( TUid )

IMPORT_C voidSetDestinationFormatL(TUidaFormatUid)

Sets the format of the audio clip. This can only be done if the audio clip does not exist.

Since
7.0s
ParameterDescription
aFormatUidUID of the audio clip format

SetDestinationNumberOfChannelsL ( TUint )

IMPORT_C voidSetDestinationNumberOfChannelsL(TUintaNumberOfChannels)

Sets the number of channels for the recorded audio clip.

The number of channels must be one of the values returned by GetSupportedNumberOfChannelsL().

Since
7.0s
ParameterDescription
aNumberOfChannelsThe number of channels to record

SetDestinationSampleRateL ( TUint )

IMPORT_C voidSetDestinationSampleRateL(TUintaSampleRate)

Sets the sample rate for the conversion destination data sink.

The sample rate must be one of the supported sample rates of the data sink. Use GetSupportedSampleRatesL() to retrieve a list of supported sample rates for the data sink. This function should not be used if the audio clip already exists; that is, in the "Open and Append" scenario, when the function's behaviour is undefined.

Since
7.0s
ParameterDescription
aSampleRateThe sample rate of the conversion destination.

SetGain ( TInt )

voidSetGain(TIntaGain)[virtual]

Sets the gain for the audio device to a specified value.

Since
5.0
ParameterDescription
aGainThe gain setting. This can be any value from zero to the value returned by a call to MaxGain(). A value which is less than zero is set to zero. A value which is greater than MaxGain() is set to MaxGain().

SetMaxWriteLength ( TInt )

voidSetMaxWriteLength(TIntaMaxWriteLength =  KMdaClipLocationMaxWriteLengthNone )[virtual]

Sets the maximum size for a file that is being recorded.

When this limit is reached, MMF stops recording and notifies the client application. Notification is caused by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.

This function is provided so that applications such as recorders can limit the amount of file storage/memory that should be allocated.

Since
7.0
ParameterDescription
aMaxWriteLengthThe maximum file size in bytes. If the default value is used, there is no maximum file size.

SetPlayWindow ( const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds & )

voidSetPlayWindow(const TTimeIntervalMicroSeconds &aStart,
const TTimeIntervalMicroSeconds &aEnd
)[virtual]

Defines a window on the audio sample data.

The window is defined in terms of a start and end position. When the current playback position reaches the window end position, or Stop() is called, the current playback position is set to the window start position and playback stops.

The current playback position is not affected by a call to SetPlayWindow() unless it is outside the new playback window, in which case it is set to the window start or end position depending on which one is closer.

The window persists until ClearPlayWindow() is called. Loading new audio sample data without adjusting or clearing the window will result in playback errors if the window is outside the new data.

Since
5.0
ParameterDescription
aStartThe position defining the start of the window, measured in microseconds. If this value is less than zero, it is set to zero. If this value is greater than aEnd, then it is swapped with aEnd.
aEndThe position defining the end of the window, measured in microseconds. If this value is greater than the value returned by Duration(), it is set to the value of Duration(). If this value is less than aStart, then it is swapped with aStart.

SetPlaybackBalance ( TInt )

IMPORT_C TIntSetPlaybackBalance(TIntaBalance =  KMMFBalanceCenter )

Sets the current playback balance.

The balance can be any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight, the default value being KMMFBalanceCenter.

Since
7.0s
ParameterDescription
aBalanceThe playback balance to set.

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SetPosition ( const TTimeIntervalMicroSeconds & )

voidSetPosition(const TTimeIntervalMicroSeconds &aPosition)[virtual]

Sets the head position.

The playback head is moved to a position which is defined in terms of a time interval measured from the beginning of the audio sample data. A subsequent call to PlayL() starts from this new position. This method's behaviour is undefined and dependent on the controller in use if it is called in the playing state and when a play window is set.
Since
5.0
ParameterDescription
aPositionThe new head position measured in microseconds.

SetPriority ( TInt, TInt )

IMPORT_C voidSetPriority(TIntaPriority,
TIntaPref
)

Sets the recording priority.

The priority is used to arbitrate between multiple objects simultaneously trying to access the sound hardware.

Since
7.0s

See also: CMdaAudioRecorderUtility::NewL()

ParameterDescription
aPriorityThe Priority Value.
aPrefThe Priority Preference.

SetRecordBalance ( TInt )

IMPORT_C TIntSetRecordBalance(TIntaBalance =  KMMFBalanceCenter )

Sets the current recording balance setting between the left and right stereo microphones

The microphone balance can be changed before or during recording and is effective immediately.

Since
7.0s
ParameterDescription
aBalanceThe balance value to set. Any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight, the default value being KMMFBalanceCenter

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

voidSetRepeats(TIntaRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &aTrailingSilence
)[virtual]

Sets the number of times the audio sample is to be repeated during the PlayL() operation.

A period of silence can follow each playing of the audio sample. The audio sample can be repeated indefinitely or until stopped.

Since
5.0
ParameterDescription
aRepeatNumberOfTimesThe number of times the audio sample, together with the trailing silence, is to be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is repeated indefinitely. If this is set to zero, then the audio sample is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever).
aTrailingSilenceThe length of the trailing silence in microseconds. Negative values will produce a panic USER 87.

SetThreadPriorityPlayback ( const TThreadPriority & )

IMPORT_C TIntSetThreadPriorityPlayback(const TThreadPriority &aThreadPriority)const

Set the priority of the playback controller's sub thread.

This can be used to increase the responsiveness of the audio plugin to minimise any lag in processing. This function should be used with care as it may have knock-on effects elsewhere in the system.

ParameterDescription
aThreadPriorityThe TThreadPriority that the thread should run under. The default is EPriorityNormal.

Returns: TInt A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a valid handle.

SetThreadPriorityRecord ( const TThreadPriority & )

IMPORT_C TIntSetThreadPriorityRecord(const TThreadPriority &aThreadPriority)const

Set the priority of the record controller's sub thread.

This can be used to increase the responsiveness of the audio plugin to minimise any lag in processing. This function should be used with care as it may have knock-on effects elsewhere in the system.

ParameterDescription
aThreadPriorityThe TThreadPriority that the thread should run under. The default is EPriorityNormal.

Returns: TInt A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a valid handle.

SetVolume ( TInt )

TInt SetVolume(TIntaVolume)[virtual]

Sets the playback volume for the audio device to a specified value.

Since
5.0
ParameterDescription
aVolumeThe volume setting. This can be any value from zero to the value returned by a call to MaxVolume(). A value that is less than zero is set to zero. A value that is greater than MaxVolume() is set to MaxVolume(). Setting a zero value mutes the sound. Setting the maximum value results in the loudest possible sound. Values less than zero would be set to zero and the values greater than the maximum permitted volume would be set to the maximum volume.

Returns: An error code indicating if the call was successful. KErrNone on success, otherwise another of the system-wide error codes. KErrNotReady indicates that the clip has not been sucessfully opened for play.

SetVolumeRamp ( const TTimeIntervalMicroSeconds & )

voidSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)[virtual]

Sets the volume increase gradient.

This defines the period over which the volume level of a played audio sample is to rise smoothly from nothing to the normal volume level.

Since
5.0
ParameterDescription
aRampDurationThe period over which the volume is to rise. A zero value causes the audio sample to be played at the normal level for the full duration of the playback. A value which is longer than the duration of the audio sample means that the sample never reaches its normal volume level.

SourceBitRateL ( )

IMPORT_C TUintSourceBitRateL()

Returns the bit rate of the audio clip.

leave
KErrNotSupported Leaves with KErrNotSupported error, if no controllers are found
Since
7.0s

Returns: The bit rate of the audio clip

State ( )

TState State()[virtual]

Returns the current state of the audio sample data.

Since
5.0

Returns: The state of the audio sample data.

Stop ( )

voidStop()[virtual]

Reimplemented from CMdaAudioClipUtility::Stop()

Stops the current operation (playback/recording/conversion).

The operation is stopped at the current location. For a playback operation, the head is positioned at the last played data.

Since
5.0

UseSharedHeap ( )

IMPORT_C voidUseSharedHeap()

Ensures that any subsequent calls to OpenXYZ() will create controllers that share a heap.

The default behaviour is that for each recorder utility a controller with its own heap is created. Each heap uses a chunk, so using this function avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then this function should be used to prevent running out of heaps or chunks.

Since
9.2

WillResumePlay ( )

IMPORT_C TIntWillResumePlay()

Waits for the client to resume the play even after the default timer expires.

Returns: An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.