---
title: "AviAudioManager..::.AppendAudioStream Method (Int32, String, Int32, Int32, Boolean)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_AviAudioManager_AppendAudioStream_5_485e1cd1.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# AviAudioManager.AppendAudioStream Method (Int32, String, Int32, Int32, Boolean)
 
Appends audio data to existing audio stream.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill.Codecs.AviProcessor (in Aurigma.GraphicsMill.Codecs.AviProcessor.dll)
 
## Syntax
  
```
Public Sub AppendAudioStream ( _streamIndex As Integer, _fileName As String, _sourceOffset As Integer, _duration As Integer, _cutToVideoDuration As Boolean _
)
```
 
```csharp
public void AppendAudioStream(int streamIndex,string fileName,int sourceOffset,int duration,bool cutToVideoDuration
)
```
 
### Parameters
 
 - streamIndex
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
 
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.

 - fileName
     - Type: [System.String](http://msdn2.microsoft.com/en-us/s1wwdcbf)
A string which specifies the name of the WAV file you want to append to the audio stream.

 - sourceOffset
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
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](http://msdn2.microsoft.com/en-us/td2s409d)
A length of the audio data (in 1/100 of seconds) to add.

 - cutToVideoDuration
     - Type: [System.Boolean](http://msdn2.microsoft.com/en-us/a28wyd50)
 
A [Boolean](http://msdn2.microsoft.com/en-us/a28wyd50) 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.
 
## Remarks
  
**Note** 
You can use this member only if you get this instance of the [AviAudioManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md) from the writer object.
   
## See Also

### Reference

- [AviAudioManager Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md)
- [AppendAudioStream Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Codecs_AviAudioManager_AppendAudioStream.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
