Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: MdaAudioSampleEditor.h
Link against: MediaClientAudio.lib

Class CMdaAudioClipUtility

CMdaAudioClipUtility

Support

Supported from 5.0

Description

A utility class which implements behaviour which is common to both the audio recorder and the audio converter.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CMdaAudioClipUtilityA utility class which implements behaviour which is common to both the audio recorder and the audio converter

Defined in CMdaAudioClipUtility:
ClearPlayWindow(), Close(), CropL(), Duration(), ENotReady, EOpen, EPlaying, ERecording, PlayL(), Position(), RecordL(), RecordTimeAvailable(), SetPlayWindow(), SetPosition(), SetRepeats(), State(), Stop(), TState, TypeL()

Inherited from CBase:
operator new()

See also:


Control


RecordL()

virtual void RecordL();

Description

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.

See also:


PlayL()

virtual void PlayL();

Description

Begins playback of audio sample data at the current volume, gain and priority levels.


Stop()

virtual void Stop();

Description

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.


CropL()

virtual void CropL();

Description

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.


SetPosition()

virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);

Description

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 CMdaAudioClipUtility::PlayL() starts from this new position.

Parameters

const TTimeIntervalMicroSeconds& aPosition

The new head position measured in microseconds.


SetPlayWindow()

virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);

Description

Defines a window on the audio sample data.

The window is defined in terms of a start and end time. All subsequent playing, position setting and position querying requests are mapped to this window.

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 CMdaAudioClipUtility::Duration(), it is set to the value of CMdaAudioClipUtility::Duration(). If this value is less than aStart, then it is swapped with aStart.


ClearPlayWindow()

virtual void ClearPlayWindow();

Description

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.


SetRepeats()

virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);

Description

Sets the number of times the audio sample is to be repeated during the play operation.

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

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.


Close()

virtual void Close();

Description

Releases any currently open audio sample data.

[Top]


Query


Position()

virtual const TTimeIntervalMicroSeconds& Position();

Description

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.

Return value

TTimeIntervalMicroSeconds&

The current head position measured in microseconds.


RecordTimeAvailable()

virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();

Description

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

Return value

TTimeIntervalMicroSeconds&

The recording time available measured in microseconds.


Duration()

virtual const TTimeIntervalMicroSeconds& Duration();

Description

Returns the duration of the audio sample data.

Return value

TTimeIntervalMicroSeconds&

The duration in microseconds.


State()

virtual TState State();

Description

Returns the current state of the audio sample data.

Return value

TState

The state of the audio sample data.


TypeL()

virtual CMdaAudioType* TypeL();

Description

Constructs and returns the format, codec and audio settings for the audio object currently open.

The function leaves if there is no open audio object.

Return value

CMdaAudioType*

A pointer to an instance of a class containing the audio settings. The caller is the owner of this object and is responsible for destroying it.

[Top]


Enumerations


Enum TState

TState

Description

Defines the possible state of the audio data sample.

ENotReady

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