---
title: "AviAudioManager..::.AddAudioStream Method (AviAudioManager, Int32, Boolean)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_AviAudioManager_AddAudioStream_3_a5f8ff88.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.AddAudioStream Method (AviAudioManager, Int32, Boolean)
 
Adds the audio stream from the [AviAudioManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md) retrieved from another AVI file.
 
**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 Function AddAudioStream ( _manager As AviAudioManager, _sourceAudioStreamIndex As Integer, _cutToVideoDuration As Boolean _
) As Integer
```
 
```csharp
public int AddAudioStream(AviAudioManager manager,int sourceAudioStreamIndex,bool cutToVideoDuration
)
```
 
### Parameters
 
 - manager
     - Type: [Aurigma.GraphicsMill.Codecs.AviAudioManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md)
 [AviAudioManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md) class instance retrieved from the [AviReader](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviReader.htm.md) which is opened on the file you need to get the audio data from.

 - sourceAudioStreamIndex
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
An index of the audio stream to retrieve the audio data from.

 - 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.
 
### 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](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)
- [AddAudioStream Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Codecs_AviAudioManager_AddAudioStream.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
