CMdaAudioClipUtility Class Reference

#include <mdaaudiosampleeditor.h>

Link against: mediaclientaudio.lib

class CMdaAudioClipUtility : public CBase

Inherits from

  • CMdaAudioClipUtility
    Public Member Enumerations
    enumTState { ENotReady, EOpen, EPlaying, ERecording }
    Public Member Functions
    pure virtual voidClearPlayWindow()
    virtual voidClipUtil_Reserved3()
    virtual voidClipUtil_Reserved4()
    pure virtual voidClose()
    pure virtual voidCropFromBeginningL()
    pure virtual voidCropL()
    pure virtual const TTimeIntervalMicroSeconds &Duration()
    pure virtual voidPlayL()
    pure virtual const TTimeIntervalMicroSeconds &Position()
    pure virtual voidRecordL()
    pure virtual const TTimeIntervalMicroSeconds &RecordTimeAvailable()
    pure virtual voidSetMaxWriteLength(TInt)
    pure virtual voidSetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
    pure virtual voidSetPosition(const TTimeIntervalMicroSeconds &)
    pure virtual voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
    pure virtual TState State()
    pure virtual voidStop()
    virtual CMdaAudioType *TypeL()
    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()

    Detailed Description

    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.

    See also: CMdaAudioRecorderUtility CMdaAudioConvertUtility

    Member Enumeration Documentation

    Enum TState

    Defines the possible state of the audio data sample.

    EnumeratorValueDescription
    ENotReady0

    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.

    Member Function Documentation

    ClearPlayWindow ( )

    voidClearPlayWindow()[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 ( )

    voidClipUtil_Reserved3()[virtual]

    Reserved function

    ClipUtil_Reserved4 ( )

    voidClipUtil_Reserved4()[virtual]

    Reserved function

    Close ( )

    voidClose()[pure virtual]

    Releases any currently open audio sample data.

    Since
    5.0

    CropFromBeginningL ( )

    voidCropFromBeginningL()[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 ( )

    voidCropL()[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 ( )

    voidPlayL()[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 ( )

    voidRecordL()[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.

    Since
    5.0

    See also: CMdaAudioRecorderUtility CMdaAudioRecorderUtility::SetGain()

    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 )

    voidSetMaxWriteLength(TIntaMaxWriteLength =  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
    ParameterDescription
    aMaxWriteLengthThe maximum file size in kilobytes. If the default value is used, there is no maximum file size.

    SetPlayWindow ( const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds & )

    voidSetPlayWindow(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
    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.

    SetPosition ( const TTimeIntervalMicroSeconds & )

    voidSetPosition(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

    SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

    voidSetRepeats(TIntaRepeatNumberOfTimes,
    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
    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.
    aTrailingSilenceThe length of the trailing silence in microseconds.

    State ( )

    TState State()[pure virtual]

    Returns the current state of the audio sample data.

    Since
    5.0

    Returns: The state of the audio sample data.

    Stop ( )

    voidStop()[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

    Returns: Always returns NULL.