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

AviAudioManager.AppendAudioStream Method (Int32, Stream, Int32, Int32, Int32, Boolean)

Appends audio data to existing audio stream.

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

Syntax

Visual Basic
Public Sub AppendAudioStream ( _
	streamIndex As Integer, _
	stream As Stream, _
	sourceOffset As Integer, _
	duration As Integer, _
	destinationOffset As Integer, _
	cutToVideoDuration As Boolean _
)
C#
public void AppendAudioStream(
	int streamIndex,
	Stream stream,
	int sourceOffset,
	int duration,
	int destinationOffset,
	bool cutToVideoDuration
)

Parameters

streamIndex

Type: System.Int32

An index of the stream you want to append the audio data with.

Note

Make sure that the audio stream with such index exists in the AVI file you create.

stream

Type: System.IO.Stream

A System.IO.Stream instance which keeps the input audio data.
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.
destinationOffset

Type: System.Int32

An offset of the destination audio data (in 1/100 of seconds). In other words, a length of the pause before the audio stream.
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.

See Also

Reference