Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: MdaAudioSampleEditor.h
Link against: MediaClientAudio.lib

Class CMdaAudioRecorderUtility

CMdaAudioRecorderUtility

Support

Supported from 5.0

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 media server implementation and is private.

If a client only needs to play back existing audio sample data, it may be better to use the simpler Audio Sample Player API.

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
CMdaAudioRecorderUtilityPlays back, records and edits audio sample data

Defined in CMdaAudioRecorderUtility:
EDefault, ELocal, ETelephonyMixed, ETelephonyNonMixed, ETelephonyOrLocal, MaxGain(), MaxVolume(), NewL(), OpenDesL(), OpenFileL(), OpenL(), SetAudioDeviceMode(), SetGain(), SetVolume(), SetVolumeRamp(), TDeviceMode

Inherited from CBase:
operator new()

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

See also:


Construction


NewL()

static CMdaAudioRecorderUtility* NewL(MMdaObjectStateChangeObserver& aObserver, CMdaServer* aServer=NULL, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);

Description

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.

Parameters

MMdaObjectStateChangeObserver& aObserver

The audio clip observer.

CMdaServer* aServer=NULL

A pointer to a server object. The default is NULL which means that one is automatically constructed and owned by this audio recorder object. If not NULL, the client must construct, and be responsible for, the server object. This option may be more efficient if a number of audio recorder objects are to be created.

TInt aPriority=EMdaPriorityNormal

This client's relative priority. This is a value between -100 and +100 and represents a relative priority. A higher value indicates a more important request. The absolute priority at which a client application runs is device-dependent.

TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality

The required behaviour if a higher priority client takes over the sound device.

Return value

CMdaAudioRecorderUtility*

Pointer to the new audio recorder object.

[Top]


Opening


OpenFileL()

void OpenFileL(const TDesC& aFilename) = 0;

Description

Opens a file to play back existing audio sample data.

Parameters

const TDesC& aFilename

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


OpenDesL()

void OpenDesL(const TDesC8& aData) = 0;

Description

Opens a descriptor to play back existing audio sample data.

Parameters

const TDesC8& aData

The 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.


OpenL()

void OpenL(TMdaClipLocation* aLocation, TMdaClipFormat* aFormat, TMdaPackage* aArg1, TMdaPackage* aArg2) = 0;

Description

Opens an audio object to play back existing audio sample data or to record new audio sample data.

Parameters

TMdaClipLocation* aLocation

The 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).

TMdaClipFormat* aFormat

The audio format.

TMdaPackage* aArg1

The codec to use.

TMdaPackage* aArg2

Audio settings.


SetAudioDeviceMode()

void SetAudioDeviceMode(TDeviceMode aMode) = 0;

Description

Sets the mode of the audio device to be used.

This determines how the API handles the configuration of the device hardware.

Parameters

TDeviceMode aMode

The audio device mode

[Top]


Controlling volume and gain


MaxVolume()

TInt MaxVolume() = 0;

Description

Gets the maximum volume for the audio device.

This is the maximum value which can be passed to CMdaAudioRecorderUtility::SetVolume().

Return value

TInt

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


SetVolume()

void SetVolume(TInt aVolume) = 0;

Description

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

Parameters

TInt aVolume

The volume setting. This can be any value from zero to the value returned by a call to CMdaAudioRecorderUtility::MaxVolume(). A value which is less than zero is set to zero. A value which is greater than CMdaAudioRecorderUtility::MaxVolume() is set to CMdaAudioRecorderUtility::MaxVolume(). Setting a zero value mutes the sound. Setting the maximum value results in the loudest possible sound.


MaxGain()

TInt MaxGain() = 0;

Description

Gets the maximum gain setting for the audio device.

This is the maximum value which can be passed toCMdaAudioRecorderUtility::SetGain().

Return value

TInt

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


SetGain()

void SetGain(TInt aGain) = 0;

Description

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

Parameters

TInt aGain

The gain setting. This can be any value from zero to the value returned by a call to CMdaAudioRecorderUtility::MaxGain(). A value which is less than zero is set to zero. A value which is greater thanCMdaAudioRecorderUtility::MaxGain() is set toCMdaAudioRecorderUtility::MaxGain().


SetVolumeRamp()

virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) = 0;

Description

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.

Parameters

const TTimeIntervalMicroSeconds& aRampDuration

The 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.

[Top]


Enumerations


Enum TDeviceMode

TDeviceMode

Description

Audio device mode

EDefault

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.

ETelephonyOrLocal

See EDefault.

ETelephonyMixed

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.

ETelephonyNonMixed

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.

ELocal

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