|
|
|
|
Location:
MdaAudioSampleEditor.h
Link against: mediaclientaudio.lib
class CMdaAudioRecorderUtility : public CMdaAudioClipUtility;
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.
MMMFClientUtility - No description.CBase - Base class for all classes to be instantiated on the heapCMdaAudioClipUtility - This class is used by both the audio recorder and audio converterCMdaAudioRecorderUtility - Plays back, records and edits audio sample dataDefined in CMdaAudioRecorderUtility:
AddMetaDataEntryL(), AudioPlayControllerImplementationInformationL(), AudioRecorderControllerImplementationInformationL(), CancelRegisterAudioResourceNotification(), ClearPlayWindow(), Close(), CropFromBeginningL(), CropL(), DestinationBitRateL(), DestinationDataTypeL(), DestinationFormatL(), DestinationNumberOfChannelsL(), DestinationSampleRateL(), Duration(), Duration(), EDefault, ELocal, ETelephonyMixed, ETelephonyNonMixed, ETelephonyOrLocal, GetAudioLoadingProgressL(), GetDRMCustomCommand(), GetGain(), GetMetaDataEntryL(), GetNumberOfMetaDataEntries(), GetPlaybackBalance(), GetRecordBalance(), GetSupportedBitRatesL(), GetSupportedDestinationDataTypesL(), GetSupportedNumberOfChannelsL(), GetSupportedSampleRatesL(), GetVolume(), MaxGain(), MaxVolume(), NewL(), OpenDesL(), OpenDesL(), OpenDesL(), OpenFileL(), OpenFileL(), OpenFileL(), OpenFileL(), OpenFileL(), OpenFileL(), OpenL(), OpenUrlL(), OpenUrlL(), PlayControllerCustomCommandAsync(), PlayControllerCustomCommandAsync(), PlayControllerCustomCommandSync(), PlayControllerCustomCommandSync(), PlayL(), Position(), RecordControllerCustomCommandAsync(), RecordControllerCustomCommandAsync(), RecordControllerCustomCommandSync(), RecordControllerCustomCommandSync(), RecordL(), RecordTimeAvailable(), RegisterAudioResourceNotification(), RegisterForAudioLoadingNotification(), RemoveMetaDataEntry(), ReplaceMetaDataEntryL(), SetAudioDeviceMode(), SetDestinationBitRateL(), SetDestinationDataTypeL(), SetDestinationFormatL(), SetDestinationNumberOfChannelsL(), SetDestinationSampleRateL(), SetGain(), SetMaxWriteLength(), SetPlayWindow(), SetPlaybackBalance(), SetPosition(), SetPriority(), SetRecordBalance(), SetRepeats(), SetThreadPriorityPlayback(), SetThreadPriorityRecord(), SetVolume(), SetVolumeRamp(), SourceBitRateL(), State(), Stop(), TDeviceMode, UseSharedHeap(), WillResumePlay(), ~CMdaAudioRecorderUtility()
Inherited from CBase:
Delete(),
Extension_(),
operator new()
Inherited from CMdaAudioClipUtility:
ENotReady,
EOpen,
EPlaying,
ERecording,
TState
virtual ~CMdaAudioRecorderUtility();
Destructor. Closes the audio clip and frees resources.
| Capability: | MultimediaDD | For applications that do not have the MultimediaDD capability, any supplied priority level (aPriority) or priority preference (aPref) will be ignored. |
static IMPORT_C CMdaAudioRecorderUtility *NewL(MMdaObjectStateChangeObserver &aObserver, CMdaServer *aServer=0, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);
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.
|
|
virtual void OpenFileL(const TDesC &aFileName);
Opens a file to play back or record audio sample data.
|
IMPORT_C void OpenFileL(const RFile &aFile);
Opens a file to play back or record audio sample data.
|
IMPORT_C void OpenFileL(const TMMSource &aSource);
Opens a file to play or record audio sample data.
|
virtual void OpenDesL(const TDesC8 &aDescriptor);
Opens a descriptor to play back or record audio sample data (const version).
|
IMPORT_C void OpenDesL(TDes8 &aDescriptor);
Opens a descriptor to play back or record audio sample data.
|
virtual void OpenL(TMdaClipLocation *aLocation, TMdaClipFormat *aFormat, TMdaPackage *aArg1=0, TMdaPackage *aArg2=0);
Opens a TMdaClipLocation package of audio data that can be played back or recorded to.
|
virtual void SetAudioDeviceMode(TDeviceMode aMode);
Sets the audio device mode. This function is provided for binary compatibility, but does not have any effect from 7.0s.
|
virtual TInt MaxVolume();
Returns the maximum volume setting for the audio device.
|
virtual TInt MaxGain();
Return the maximum value for the gain
|
virtual void SetVolume(TInt aVolume);
Sets the playback volume for the audio device to a specified value.
|
virtual void SetGain(TInt aGain);
Sets the gain for the audio device to a specified value.
|
virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration);
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.
|
IMPORT_C void OpenFileL(const TDesC &aFileName, TUid aRecordControllerUid, TUid aPlaybackControllerUid=TUid::Null(), TUid aDestinationFormatUid=TUid::Null(), TFourCC aDestinationDataType=KFourCCNULL);
Opens an audio clip from a file to play back existing audio data or to record new audio data.
|
IMPORT_C void OpenFileL(const RFile &aFile, TUid aRecordControllerUid, TUid aPlaybackControllerUid=TUid::Null(), TUid aDestinationFormatUid=TUid::Null(), TFourCC aDestinationDataType=KFourCCNULL);
Opens an audio clip from a file to play back existing audio data or to record new audio data.
|
IMPORT_C void OpenFileL(const TMMSource &aSource, TUid aRecordControllerUid, TUid aPlaybackControllerUid=TUid::Null(), TUid aDestinationFormatUid=TUid::Null(), TFourCC aDestinationDataType=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.
|
IMPORT_C void OpenDesL(TDes8 &aDescriptor, TUid aRecordControllerUid, TUid aPlaybackControllerUid=TUid::Null(), TUid aDestinationFormatUid=TUid::Null(), TFourCC aDestinationDataType=KFourCCNULL);
Opens an audio clip from a descriptor to play back existing audio data from or to record new audio data to.
|
IMPORT_C void OpenUrlL(const TDesC &aUrl, TInt aIapId, TUid aRecordControllerUid, TUid aPlaybackControllerUid=TUid::Null(), TUid aDestinationFormatUid=TUid::Null(), TFourCC aDestinationDataType=KFourCCNULL);
Opens an audio clip from a URL to play back existing audio data from or to record new audio data to.
|
IMPORT_C void OpenUrlL(const TDesC &aUrl, TInt aIapId=KUseDefaultIap, const TDesC8 &aMimeType=KNullDesC8);
Opens an audio clip from a URL to play back or record audio sample data.
|
IMPORT_C TInt GetGain(TInt &aGain);
Returns the current gain setting of the audio device.
|
|
IMPORT_C TInt GetVolume(TInt &aVolume);
Returns the current volume setting for the audio device.
|
|
IMPORT_C TInt SetPlaybackBalance(TInt aBalance=KMMFBalanceCenter);
Sets the current playback balance.
The balance can be any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight, the default value being KMMFBalanceCenter.
|
|
IMPORT_C TInt GetPlaybackBalance(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.
|
|
IMPORT_C TInt SetRecordBalance(TInt aBalance=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.
|
|
IMPORT_C TInt GetRecordBalance(TInt &aBalance);
Returns the current recording balance setting between the left and right stereo microphones.
|
|
IMPORT_C TInt GetNumberOfMetaDataEntries(TInt &aNumEntries);
Returns the number of meta data entries associated with this clip.
|
|
IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TInt aMetaDataIndex);
Returns the specified meta data entry from the current audio clip.
|
|
IMPORT_C void AddMetaDataEntryL(CMMFMetaDataEntry &aMetaDataEntry);
Adds a meta data entry to the audio clip.
|
IMPORT_C TInt RemoveMetaDataEntry(TInt aMetaDataIndex);
Removes a specified meta data entry from the audio clip.
|
|
IMPORT_C void ReplaceMetaDataEntryL(TInt aMetaDataIndex, CMMFMetaDataEntry &aMetaDataEntry);
Replaces the specified meta data entry with a new entry.
|
| Capability: | MultimediaDD | For applications that do not have the MultimediaDD capability, any supplied priority level (aPriority) or priority preference (aPref) will be ignored. |
IMPORT_C void SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
Sets the recording priority.
The priority is used to arbitrate between multiple objects simultaneously trying to access the sound hardware.
|
IMPORT_C void GetSupportedDestinationDataTypesL(RArray< TFourCC > &aSupportedDataTypes);
Returns a list of the supported codecs for the conversion destination.
|
IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
Sets the codec to use with the record controller.
|
IMPORT_C TFourCC DestinationDataTypeL();
Returns the codec that is currently set for the destination audio clip.
|
IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
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.
|
IMPORT_C TUint DestinationBitRateL();
Returns the bit rate in bits per second that the data sink is currently set to.
|
IMPORT_C TUint SourceBitRateL();
Returns the bit rate of the audio clip.
|
|
IMPORT_C void GetSupportedBitRatesL(RArray< TUint > &aSupportedBitRates);
Returns a list of the supported bit rates for recording to the data sink.
|
IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
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.
|
IMPORT_C TUint DestinationSampleRateL();
Returns the sample rate in samples/second that the destination data sink is currently set to.
|
IMPORT_C void GetSupportedSampleRatesL(RArray< TUint > &aSupportedSampleRates);
Returns a list of supported recording sample rates.
|
IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
Sets the format of the audio clip. This can only be done if the audio clip does not exist.
|
IMPORT_C TUid DestinationFormatL();
Returns the format(UID) of the destination audio clip.
|
IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
Sets the number of channels for the recorded audio clip.
The number of channels must be one of the values returned by GetSupportedNumberOfChannelsL().
|
IMPORT_C TUint DestinationNumberOfChannelsL();
Returns the number of channels that the destination audio clip is currently configured to support.
|
IMPORT_C void GetSupportedNumberOfChannelsL(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.
|
virtual TState State();
Returns the current state of the audio sample data.
|
virtual void PlayL();
Begins playback of audio sample data at the current playback position using the current volume, gain and priority settings.
| Capability: | UserEnvironment | For recording - the requesting client process must have the UserEnvironment capability. |
virtual void RecordL();
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.
virtual void 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.
virtual void 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.
virtual void SetPosition(const TTimeIntervalMicroSeconds &aPosition);
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.
|
virtual const TTimeIntervalMicroSeconds &Position();
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.
|
virtual const TTimeIntervalMicroSeconds &RecordTimeAvailable();
Returns the recording time available for the selected file or descriptor and encoding format.
|
virtual const TTimeIntervalMicroSeconds &Duration();
Returns the duration of the audio clip.
|
IMPORT_C TMMFDurationInfo Duration(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.
|
|
virtual void SetPlayWindow(const TTimeIntervalMicroSeconds &aStart, const TTimeIntervalMicroSeconds &aEnd);
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.
|
virtual void 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.
virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds &aTrailingSilence);
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.
|
virtual void SetMaxWriteLength(TInt aMaxWriteLength=KMdaClipLocationMaxWriteLengthNone);
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.
|
virtual void 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.
IMPORT_C void RegisterForAudioLoadingNotification(MAudioLoadingObserver &aCallback);
Register to receive notifications of audio loading/rebuffering
|
IMPORT_C void GetAudioLoadingProgressL(TInt &aPercentageComplete);
Returns the current progress of audio loading.
|
IMPORT_C const CMMFControllerImplementationInformation &AudioPlayControllerImplementationInformationL();
Returns the controller implementation information associated with the playback controller
|
IMPORT_C const CMMFControllerImplementationInformation &AudioRecorderControllerImplementationInformationL();
Returns the controller implementation information associated with the recording controller.
|
IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom);
Sends a synchronous custom command to the recording controller.
|
|
IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2);
Sends a synchronous custom command to the recording controller.
|
|
IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, 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.
|
IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, 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.
|