Aurigma Graphics Mill 5.5 for .NET
AviAudioManager Class
This class encapsulates audio-related features of the AVI Processor.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill.Codecs.AviProcessor (in Aurigma.GraphicsMill.Codecs.AviProcessor.dll)
Syntax
Visual Basic
Public NotInheritable Class AviAudioManager _ Inherits LockableObject
C#
public sealed class AviAudioManager : LockableObject
Remarks
AVI files can contain not only video data, but also audio data as well. One file can contain several audio tracks (or streams) synchronized with video. When the AVI movie is played, one of audio streams is used. Advanced video players enables the user to select which audio stream to play, simpler players always play only the first stream. This way you can create AVI files which contains audio tracks in different languages, etc.
AVI Processor can both read and write audio data from/to AVI files. To provide this functionality both AviReader and AviWriter have the property named AudioManager which returns an instance of this class.
This class implements two kinds of methods and properties: one works only when the audio manager object is returned from the AviReader and another - when it is returned from AviWriter. If you try to extract audio data from the writer or add it to reader, an appropriate method will fail. Let's examine both these groups of members.
Reader-related Members
- ExportAudioStream(Int32, String) method - extracts audio data and saves it to a WAV file or Stream object.
- GetDuration(Int32) method - gets audio data length (in 1/100 of seconds).
- GetChannelCount(Int32) method - gets a number of channels in the audio stream. This way you can detect whether it is mono, stereo, quadro, or Dolby sound.
- GetBitsPerSample(Int32) method - gets a number of bits per sample in the audio data.
- GetAverageBytesPerSecond(Int32) method - gets an averate bytes per second rate of the audio stream.
- AudioStreamCount property - returns a number of audio streams in the AVI file.
Writer-related Members
- AddAudioStream(String, Int32, Int32, Boolean) method - adds new audio stream to the AVI file. You can add either empty stream, or load audio data from the WAV file, Stream object, or another audio manager.
- AppendAudioStream(Int32, String, Int32, Int32, Boolean) method - appends audio data to the end of the existing audio stream.
In addition to this, you can get duration of WAV files using the GetAudioDuration(String) static method.