Contents |
The Audio Effects API supports audio related effects such as equalizer and reverb. These APIs provide the mechanism of passing requests over the DevSound process boundary. The adaptation components implement these APIs.
API category | public |
API type | c++ |
API libraries | AudioEqualizerEffect.lib, BassBoostEffect.lib, DistanceAttenuationEffect.lib, DopplerBase.lib, EffectBase.lib, EnvironmentalReverbEffect.lib, ListenerDopplerEffect.lib, ListenerLocationEffect.lib, ListenerOrientationEffect.lib, LocationBase.lib, LoudnessEffect.lib, OrientationBase.lib, RoomLevelEffect.lib, SourceDopplerEffect.lib, SourceLocationEffect.lib, SourceOrientationEffect.lib, StereoWideningEffect.lib |
Location | /sf/os/mmaudio/mmaudio_pub/audio_effects_api
|
Buildfiles | /sf/os/mmaudio/mmaudio_pub/audio_effects_api/group/bld.inf
|
The Effect API gives audio applications the ability to control audio effects. Audio effects are abstractions of audio processing that apply artificial sounds or enhancements to audio. The Audio Effect API relies on the Effects Framework to communicate with software or hardware entities that handle audio effects processing.
The Effect API is introduced in Symbian OS, S60 3.0. The Effects Framework makes extensive use of the custom command facility that requires a controller plug-in capable of supporting custom commands defined for the Effects Framework. These custom commands are supported in Symbian OS, S60 3.0 or higher.
Classes | Files |
---|---|
|
/epoc32/include/AudioEffectBase.h
CAudioEqualizer
/epoc32/include/AudioEqualizerBase.h
CBassBoost
/epoc32/include/BassBoostBase.h
CDistanceAttenuation
/epoc32/include/DistanceAttenuationBase.h
CDoppler
/epoc32/include/DopplerBase.h
CEnvironmentalReverb
/epoc32/include/EnvironmentalReverbBase.h
CListenerDoppler
/epoc32/include/ListenerDopplerBase.h
CListenerLocation
/epoc32/include/ListenerLocationBase.h
CListenerOrientation
/epoc32/include/ListenerOrientationBase.h
CLocation
/epoc32/include/LocationBase.h
CLoudness
/epoc32/include/LoudnessBase.h
COrientation
/epoc32/include/OrientationBase.h
CRoomLevel
/epoc32/include/RoomLevelBase.h
CSourceDoppler
/epoc32/include/SourceDopplerBase.h
CSourceLocation
/epoc32/include/SourceLocationBase.h
CSourceOrientation
/epoc32/include/SourceOrientationBase.h
CStereoWidening
/epoc32/include/StereoWideningBase.h
MAudioEffectObserver
/epoc32/include/MAudioEffectObserver.h
MAudioEqualizerObserver
/epoc32/include/MAudioEqualizerObserver.h
MBassBoostObserver
/epoc32/include/MBassBoostObserver.h
MDistanceAttenuationObserver
/epoc32/include/MDistanceAttenuationObserver.h
MDopplerObserver
/epoc32/include/MDopplerObserver.h
MEnvironmentalReverbObserver
/epoc32/include/MEnvironmentalReverbObserver.h
MLocationObserver
/epoc32/include/MLocationObserver.h
MOrientationObserver
/epoc32/include/MOrientationObserver.h
MRoomLevelObserver
/epoc32/include/MRoomLevelObserver.h
MStereoWideningObserver
/epoc32/include/MStereoWideningObserver.h
TEfAudioEqualizer
/epoc32/include/AudioEqualizerData.h
TEfAudioEqualizerBand
/epoc32/include/AudioEqualizerData.h
TEfAudioEqualizerCombined
/epoc32/include/AudioEqualizerData.h
TEfBassBoostData
/epoc32/include/BassBoostData.h
TEfCommon
/epoc32/include/AudioEffectData.h
TEfDistanceAttenuation
/epoc32/include/DistanceAttenuationData.h
TEfDoppler
/epoc32/include/DopplerData.h
TEfEnvironmentalReverb
/epoc32/include/EnvironmentalReverbData.h
TEfLocation
/epoc32/include/LocationData.h
TEfLoudnessData
/epoc32/include/LoudnessData.h
TEfOrientation
/epoc32/include/OrientationData.h
TEfRoomLevel
/epoc32/include/RoomLevelData.h
TEfStereoWidening
/epoc32/include/StereoWideningData.h
/epoc32/include/MListenerDopplerObserver.h
, /epoc32/include/MListenerLocationObserver.h
, /epoc32/include/MListenerOrientationObserver.h
, /epoc32/include/MLoudnessObserver.h
, /epoc32/include/MSourceDopplerObserver.h
, /epoc32/include/MSourceLocationObserver.h
, /epoc32/include/MSourceOrientationObserver.h
The Audio Effects API includes one or more of following interfaces:
CMdaAudioConvertUtility
, CMdaAudioInputStream
, CMdaAudioOutputStream
, CMdaAudioPlayerUtility
, and CMdaAudioRecorderUtility
. These utilities are application-level APIs that offer audio client applications the ability to play, record, or convert audio.
All the Effect interfaces are method calls. However, the Effects Framework relies on the MMF Controller Framework, which has a client-server boundary. When a client issues requests, the requests and data are encapsulated into messages that can be passed across the client-server boundary. Synchronous method calls block the client thread until they return. However, most of the client method calls do not require a message to be sent. The methods that do generate a message are completed immediately when possible.
NewL
method. A client application creates the effect after the application initializes the MDA audio utility but before the application starts playing the audio. On the contrary, the effect is deleted before the MDA utility is deleted.
ApplyL()
method on the effect to apply the new settings. Settings are automatically applied when they are enabled or disabled.
EnableL()
method on the effect. Enabling an effect that is already enabled does nothing. To stop processing an effect, the DisableL()
method on the effect is called. Disabling an effect that is already disabled does nothing.
Enforce
method on the effect. In this case, the audio pre-empts the audio stream through the utility that controls that audio stream with the KErrEnforcedEffectPreempted
error.
KLostUpdateRights
event. When an application regains the right to control the effects settings, it is notified through the observer interface with the KGaindUpdateRights
event. By default, all effects initially have the update rights.
NewL()
methods for the effects leaves with KErrNotSupported
. Even if effect processing is supported, it is not guaranteed that every method of an effect is implemented. In this case, unsupported operations on the effect are ignored by the audio system.
NewLs
with custom interfaces as arguments leaves with KErrNotSupported
.
This example shows how a client audio application uses the equalizer effect. Note that an MDA Player utility must be created first and must not be deleted before the equalizer effect is deleted. The following steps and diagrams illustrate the stages of the equalizer effect lifecycle. All effects have similar sequences while their operations and events may be different.
NewL()
method. The client may register an observer with the effect. The effect is then ready to be used.
Enable()
or ApplyL()
. Initially, all effects are disabled. The Enable()
method must be used to enable the effect if it is disabled. Enabling causes the effect settings to be applied. After the effect is enabled, new settings are applied by using the ApplyL()
method. The following diagram shows a new setting being applied after the effect is enabled.
EffectChange()
callback. Clients receive event notifications after successful registration. Refer to the Create the effect section above for the registration sequence. If clients do not want to receive further event notifications, use the UnregisterObserver()
method. It is recommended to monitor the events if the effect is enabled. In the following diagram the effect cannot be applied when the client attempts to apply the effect on the stream. In such a case, the effect does not have update rights. In addition, because the client indicates that the effect must be enforced, the stream is pre-empted.
DisableL()
method. After an effect is disabled, the effect can be removed by deleting the object. The client can also delete the effect without disabling it first.
For each effect interface object created, there are two additional support objects and an adaption custom interface effect object created. The size of the support object depends on the effect type. Some effects have larger data structures than others. However, in general, each effect object requires an estimated 2-KB RAM.
The basic functionality of an Effect API can be extended, but this may introduce binary compatibility issues if the interface class is changed. However, new effect classes with additional functionality can be created through derivation.
The leave mechanism of the Symbian platform is used to handle exception situations. Each leaving method has a list of possible leave codes and the meaning of the code. Clients are required to TRAP the leaving methods and handle them appropriately or leave it up to a higher-level TRAP harness.
A number of error conditions can occur when the Effect APIs are used. Each Effect API has different error conditions. The errors common to all effects are listed as follows:
KErrAccessDenied
- Attempting to apply effect settings when the effect has lost update rights.
KErrArgument
- Attempting to set an effect setting to an invalid value.
KErrNoMemory
- Insufficient amount of memory available to carry out the operation.
KErrNotSupported
- The specified effect is not supported during the effect creation process.