Audio Level

From AVObjects Knowledge Base
Revision as of 18:35, 11 October 2007 by Admin (Talk | contribs)
Jump to: navigation, search

Provides support for level processing of audio stream. Supports VU meter, audio amplifier, event triggers, auto gain and volume controls.

Contents

Overview

{{{name}}}

Type: DirectShow filter
Status: Beta
Redistributables: {{{deliverables}}}
Setup Directory {{{setup}}}
Pricing: {{{pricing}}}
Download: {{{download}}}

The Audio Level filter is used to accomplish various manipulation techniques on an audio stream. It accepts audio data in PCM format, transforms it into its audio data stream for further processing and/or rendering. The Audio Level filter is able to setup transform functions for each audio channel.

Features

  • VU meter
  • Audio amplifier
  • Auto gain and volume controls
  • Audio trigger

Supported Standards

  • The E.B.U. standart peak-programme meter for the control of international transmissions

Basic specs

Filter Interfaces: IAudioLevel, IBaseFilter, ISpecifyPropertyPages, IPersist
Input stream: PCM Audio
Input Pin Media Types: MEDIATYPE_Audio

MEDIASUBTYPE_PCM
FORMAT_WaveFormatEx

Input Pin Interfaces: IPin, IQualityControl, IMemInputPin
Output streams: PCM Audio
Output Pin Media Types: MEDIATYPE_Audio

MEDIASUBTYPE_PCM
FORMAT_WaveFormatEx

Output Pin Interfaces: IPin, IQualityControl, IMediaSeeking
Filter Name: MediaLooks Audio Level
Filter CLSID: 380949BC-AD26-4862-BF30-1F709075DF5B
Executable: ALevel.dll
Merit: MERIT_DO_NOT_USE
Filter categories: DirectShow filters: CLSID_LegacyAmFilterCategory {083863F1-70DE-11d0-BD40-00A0C911CE86}

MediaLooks filters: CLSID_MediaLooksCategory {1D0D0809-3513-244F-4B3D-2A0A1D131B17}

Usage in GraphEdit

Filter can be found in the following categories:

  • DirectShow filters
  • MediaLooks filters

Remarks

Audio trigger is used for getting the level of amplitude in an audio stream. When the amplitude of the signal reaches the specified level, the application gets sent messages. The treshold of triggering may work at both the upper and the lower front. The upper one reacts on exceeding the given level of the signal amplitude, while the lower one reacts on the amplitude level detraction. The following example, - determining silence in a sound channel, - illustrates the usage of the audio trigger.

  1. First, we should choose the type of the messages, sent by the trigger. Currently 3 message types are supported:
    • trigger notification interface (IAudioLevelNotify),
    • handles to events objects,
    • DirectShow event notifications.
    According to the message types 3 corresponding functions are provided: AdviseNotify, AdviseEvent and AdviseDSEvent.
  2. Then the trigger's front has to be chosen. In case of determining silence in a channel we need the lower front.
  3. The trigger works in the following way. When the triggering threshold of the signal level is reached, the application is sent the OnLevelReachedBegin message. As soon as the signal level leaves the triggering threshold, the application is sent the OnLevelReachedEnd message. The triggering treshold can be specified in two units: decibels (dB) and percent (%) divided by 100. When specified in percent, the treshold value belongs to the interval from 0 up to 1. For instance, when determining silence, the treshold may have value 0.17, which is 17%.
  4. Now is time to set the triggering delay in milliseconds (ms). When the given treshold is reached, the signal has to be at that level for the given number of ms for the trigger to switch. When the delay is passed the application will get sent the OnLevelReachedBegin message. But this message will not be sent if the signal leaves the given level before the delay expires. To determine silence in a channel, a normal value for the triggering delay is 500 ms. If the lower front chosen, and the treshold equals to 0.17, and the signal remains below the treshold for 500 ms, the application will get the OnLevelReachedBegin message, which means that silence started in the channel. As soon as the signal exceeds 0.17, the application will get the OnLevelReachedEnd message, which means that there's no silence in the channel any longer.
  5. The rest of parameters and the way of processing depend on the message type. When using the notification interface message type, the application has to pass a reference to the event interface. When dealing with standard Windows messages, - handles to event objects have to be passed. Use the CreateEvent function for creating handles. And when using DirectShow notifications, DirectShow interfaces are used for handling messages. The corresponding constants for the messages are EC_LEVEL_REACHED_BEGIN and EC_LEVEL_REACHED_END.
  6. The Unadvise method uses to terminate the advise link established with the IAudioLevel interface. The dwAdviseCookie parameter identifies the link to terminate.



Auto gain control: There are 3 modes, used to avoid acoustic overfilling:

  • Without control (there will be crackle if the signal is amplified).
  • Fixed mode, which is when a maximum amplification koefficient is specified. Further, while processing the signal, the sound level is adjusted automatically to avoid overfilling.
  • Float mode. The sound level is continuously approaching the specified amplification mark, at the same time avoiding overfilling.

When in the fixed mode, the level used is the highest possible. When in the float mode, the average level is used. Float is good when the signal is an ordinary sound.


You can get any extra information from the interface definition in the IDL file.

Downloads

See also

Personal tools