This documentation is for the old version. Go to the latest Graphics Mill docs

AviAudioManager.AddAudioStream Method (AviAudioManager, Int32, Int32, Int32, Boolean)

Adds the audio stream from the AviAudioManager retrieved from another AVI file.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill.Codecs.AviProcessor (in Aurigma.GraphicsMill.Codecs.AviProcessor.dll)

Syntax

Visual Basic
Public Function AddAudioStream ( _
	manager As AviAudioManager, _
	sourceAudioStreamIndex As Integer, _
	sourceOffset As Integer, _
	duration As Integer, _
	cutToVideoDuration As Boolean _
) As Integer
C#
public int AddAudioStream(
	AviAudioManager manager,
	int sourceAudioStreamIndex,
	int sourceOffset,
	int duration,
	bool cutToVideoDuration
)

Parameters

manager

Type: Aurigma.GraphicsMill.Codecs.AviAudioManager

AviAudioManager class instance retrieved from the AviReader which is opened on the file you need to get the audio data from.
sourceAudioStreamIndex

Type: System.Int32

An index of the audio stream to retrieve the audio data from.
sourceOffset

Type: System.Int32

An offset of the source audio data (in 1/100 of seconds). In other words, how many data to skip from the source file.
duration

Type: System.Int32

A length of the audio data (in 1/100 of seconds) to add.
cutToVideoDuration

Type: System.Boolean

A Boolean value that specifies whether to truncate audio data to fit the duration of the video.

Note

Keep in mind that video duration is determined in the moment when you call this method. It means that if you:

  1. Add half of frames;
  2. Add audio stream with this argument = true;
  3. Add the rest frames;

only the first half of frames will be dubbed. The rest frames will be silent.

That is the reason why it is important to add audio data only when you add all video frames. You can use this fact to synchronize audio and video though.

Return Value

An integer value which specifies the index of new audio stream in the AVI file.

Remarks

Note

You can use this member only if you get this instance of the AviAudioManager from the writer object.

See Also

Reference