CMdaAudioClipUtility Class Reference

class CMdaAudioClipUtility : public CBase

This class is used by both the audio recorder and audio converter. This class should not be used, other than the TState enum.

Prior to 7.0s the pure virtual functions in this class were implemented virtual functions. In 7.0s this changed, so now any classes derived from this one must implement the functions themselves.

CMdaAudioRecorderUtility CMdaAudioConvertUtility

Inherits from

Member Functions Documentation

ClearPlayWindow()

void ClearPlayWindow ( ) [pure virtual]

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

ClipUtil_Reserved3()

void ClipUtil_Reserved3 ( ) [virtual]

Reserved function

ClipUtil_Reserved4()

void ClipUtil_Reserved4 ( ) [virtual]

Reserved function

Close()

void Close ( ) [pure virtual]

Releases any currently open audio sample data.

Since
5.0

CropFromBeginningL()

void CropFromBeginningL ( ) [pure virtual]

Deletes all audio sample data from the beginning of the audio clip. 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

CropL()

void CropL ( ) [pure virtual]

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

Duration()

const TTimeIntervalMicroSeconds & Duration ( ) [pure virtual]

Returns the duration of the audio sample data.

Since
5.0

PlayL()

void PlayL ( ) [pure 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 ( ) [pure 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

RecordL()

void RecordL ( ) [pure 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 CMdaAudioRecorderUtility::SetGain() , as the initial gain is undefined. The gain might also have been modified by another client application.

RecordTimeAvailable()

const TTimeIntervalMicroSeconds & RecordTimeAvailable ( ) [pure virtual]

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

Since
5.0

SetMaxWriteLength(TInt)

void SetMaxWriteLength ( TInt aMaxWriteLength =  KMdaClipLocationMaxWriteLengthNone ) [pure 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
5.0

Parameters

TInt aMaxWriteLength =  KMdaClipLocationMaxWriteLengthNone The maximum file size in kilobytes. If the default value is used, there is no maximum file size.

SetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)

void SetPlayWindow ( const TTimeIntervalMicroSeconds & aStart,
const TTimeIntervalMicroSeconds & aEnd
) [pure 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

Parameters

const TTimeIntervalMicroSeconds & aStart The 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.
const TTimeIntervalMicroSeconds & aEnd The 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.

SetPosition(const TTimeIntervalMicroSeconds &)

void SetPosition ( const TTimeIntervalMicroSeconds & aPosition ) [pure 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.

Since
5.0

Parameters

const TTimeIntervalMicroSeconds & aPosition

SetRepeats(TInt, const TTimeIntervalMicroSeconds &)

void SetRepeats ( TInt aRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds & aTrailingSilence
) [pure 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

Parameters

TInt aRepeatNumberOfTimes The 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.
const TTimeIntervalMicroSeconds & aTrailingSilence The length of the trailing silence in microseconds.

State()

TState State ( ) [pure virtual]

Returns the current state of the audio sample data.

Since
5.0

Stop()

void Stop ( ) [pure virtual]

Stops the playback or recording operation.

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

Since
5.0

TypeL()

CMdaAudioType * TypeL ( ) [virtual]

This function is no longer supported. It is provided for binary compatibility with previous releases and always leaves with KErrNotSupported.

Since
5.0

Member Enumerations Documentation

Enum TState

Defines the possible state of the audio data sample.

Enumerators

ENotReady = 0

The audio clip recorder or audio converter has been constructed but no file or descriptor has been opened.

EOpen

Files or descriptors are open but no playing or recording operation is in progress.

EPlaying

Audio sample data is playing.

ERecording

New audio sample data is being recorded.