Audio Level

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
Line 94: Line 94:
 
<LI>
 
<LI>
 
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.
 
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.
<OL>
+
<OL>You can get any extra information from the interface definition in the IDL file.
 
<br><br>
 
<br><br>
 
Auto gain control: There are 3 modes, used to avoid acoustic overfilling:
 
Auto gain control: There are 3 modes, used to avoid acoustic overfilling:

Revision as of 12:13, 15 August 2007

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 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.
      You can get any extra information from the interface definition in the IDL file.

      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.

      Downloads

      See also








      По достижению амплитуды сигнала заданного значения приложению посылаются сообщения. Порог срабатывания может работать на два фронта, верхний и нижний. Верхний фронт работает на превышения амплитуды сигнала заданного значения, нижний на пренижение. Например, стандартная задача определения тишины в звуковом канале с помощью аудио триггера решается следующим образом. 
      

      Первое, необходимо выбрать тип сообщений посылаемых триггером. В настоящий момент поддерживается 3 типа: интерфейс нотификации триггера (IAudioLevelNotify), handles to event objects, DirectShow event notifications. В соответствии с 3 типами сообщений в интерфейсе предусмотрено 3 ф-ий: AdviseNotify, AdviseEvent and AdviseDSEvent.

      Второе, необходимо выбрать фронт работы триггера. В случае определения тишины в канале, нужен нижний фронт.

      Третье. Триггер работает след образом - по достижению уровня звукового сигнала порога срабатывания, приложению послылается сообщение OnLevelReachedBegin. Как только уровень сигнала выходит за границу порога срабатывания, в зависимости от фронта работы, приложению посылается OnLevelReachedEnd. Порог срабатывания можно задавать в двух системах измерения: в децибеллах и в процентах. В случае процентов значение порога колеблится между 0 и 1. Например для определения тишины можно установить порог, равный 0.17.

      Четвертое. Необходимо установить задержку срабатывания порога триггера в милисекундах. Достигнув определенного порога срабатывания сигнал должен оставатся в заданной области, в зависимости от фронта работы, определенное кол-во милисекунд. По прошествию заданного кол-ва милисекунд приложению будет послано сообщение OnLevelReachedBegin. Если в течении этого промежутка времени сигнал выйдет за границу, сообщение OnLevelReachedBegin не будет послано. В случае определния тишины в канале, нормальным значением является 500ms. При заданном нижнем фронте и пороге срабатывания 0.17, сигнал должен оставтся еще 500ms ниже порога, чтоб приложение получило сообщение OnLevelReachedBegin - началась тишина в канале. При превышении сигнала порога 0.17, приложение получит OnLevelReachedEnd - закончилась тишина.

      Пятое. Остальные параметры и способ обработки сообщений зависят от типа. В случае интерфейса нотификации, приложению необходимо передать указатель на интерфейс событий. В случае стандартный виндовых сообщений, нужно передать handles на event objectes. Ф-ия CreateEvent создает handles. А в случае DirectShow нотификаций, обработка сообщений производится с помощью интерфейсов DirectShow. Константы сообщений EC_LEVEL_REACHED_BEGIN/EC_LEVEL_REACHED_END.

      Дополнительную информацию можно получить из описания интерфейса в IDL файле.

      \\

      Auto gain control: для того чтобы не было переполнений в звуке. есть 3 режима. без контроля - тогда при усилении треск будет. fixed mode - задается максимальный коэфф усиления, а дальше во время работы уровень звука автоматом подбирается, чтоб небыло пеерполнений (максимально громкий и какчественный при данном услении). float mode - уровень звука постоянно стремится к заданной отметке усиления, но в тоже время чтоб не было пеерполнений. в fixed режиме уровень действует как максимально возможный. в случае float это средний уровень. float хорошь когда идет нормальный звук и чтоб точняк не было переполнений
Personal tools