AVRecorder.SetAudioDevice
-------------------------

Sets the audio device to use.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [AVRecorder](component_AVRecorder.md) | [6.1](newinversion61.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "AVRecorder.SetAudioDevice"; AVSession; Device ) 

**MBS**( **"AVRecorder.SetAudioDevice";** /\* Sets the audio device to use. \*/  
**$AVSession**; /\* The ID for the AVRecorder session as returned by [AVRecorder.Init](AVRecorderInit.md). \*/   
**$Device**) /\* The device name, ID or index.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| AVSession | The ID for the AVRecorder session as returned by [AVRecorder.Init](AVRecorderInit.md). | $AVSession |
| Device | The device name, ID or index. | 0 |

### Result

Returns OK or error.

### Description

Sets the audio device to use.  
### Examples

Sets first audio device:

 Set Variable \[$r ; Value:MBS ("AVRecorder.SetAudioDevice"; AVRecorder::Session ; 0)\]  
Use audio device with name "Built-in Microphone":

 Set Variable \[$r ; Value:MBS ("AVRecorder.SetAudioDevice"; AVRecorder::Session ; "Built-in Microphone")\]  
### See also

- [AVRecorder.AudioDeviceInfo](AVRecorderAudioDeviceInfo.md)
- [AVRecorder.GetAudioDevice](AVRecorderGetAudioDevice.md)
- [AVRecorder.GetVideoDevice](AVRecorderGetVideoDevice.md)
- [AVRecorder.Init](AVRecorderInit.md)
- [AVRecorder.SetVideoDevice](AVRecorderSetVideoDevice.md)

### Release notes

- **Version 11.3**
    - Improved [AVRecorder.AudioDeviceInfo](https://www.mbsplugins.eu/AVRecorderAudioDeviceInfo.shtml), [AVRecorder.SetAudioDevice](https://www.mbsplugins.eu/AVRecorderSetAudioDevice.shtml), [AVRecorder.SetVideoDevice](https://www.mbsplugins.eu/AVRecorderSetVideoDevice.shtml) and [AVRecorder.VideoDeviceInfo](https://www.mbsplugins.eu/AVRecorderVideoDeviceInfo.shtml) to query device list automatically.

### Example Databases

- [AVRecorder/AV Recorder Record Dictation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AV%20Recorder%20Record%20Dictation.shtml#1ScriptAnchor_)
- [AVRecorder/AVRecorder iOS Test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AVRecorder%20iOS%20Test.shtml#5ScriptAnchor_)
- [AVRecorder/AVRecorder](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AVRecorder.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.3pr6](https://www.mbsplugins.de/archive/2021-07-06/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [AVRecorder on iOS](https://www.mbsplugins.de/archive/2020-07-16/AVRecorder_on_iOS/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 9th February 2016 , last changed 22nd February 2016

  
[AVRecorder.RequestAccessForMediaType](AVRecorderRequestAccessForMediaType.md) - [AVRecorder.SetAutomaticallyAdjustsVideoMirroring](AVRecorderSetAutomaticallyAdjustsVideoMirroring.md)

[HTML Version](AVRecorderSetAudioDevice.shtml)