|
| 1 | +--- |
| 2 | +title: How to configure a Microphone Array - Speech Service |
| 3 | +titleSuffix: Azure Cognitive Services |
| 4 | +description: Learn how to configure a Microphone Array so that the Speech Devices SDK can use it. |
| 5 | +services: cognitive-services |
| 6 | +author: mswellsi |
| 7 | +manager: yanbo |
| 8 | +ms.service: cognitive-services |
| 9 | +ms.subservice: speech-service |
| 10 | +ms.topic: conceptual |
| 11 | +ms.date: 05/01/2020 |
| 12 | +ms.author: wellsi |
| 13 | +--- |
| 14 | + |
| 15 | +# How to configure a Microphone Array |
| 16 | + |
| 17 | +In this article, you learn how to configure a [microphone array](https://aka.ms/sdsdk-microphone). It includes setting the working angle, and how to select which microphone is used for the Speech Devices SDK. |
| 18 | + |
| 19 | +The Speech Devices SDK works best with a microphone array that has been designed according to [our guidelines](https://aka.ms/sdsdk-microphone). The microphone array configuration can be provided by the Operating System or supplied through one of the following methods. |
| 20 | + |
| 21 | +The Speech Devices SDK initially supported microphone arrays by selecting from a fixed set of configurations. |
| 22 | + |
| 23 | +```java |
| 24 | +private static String DeviceGeometry = "Circular6+1"; // "Circular6+1", "Linear4", |
| 25 | +private static String SelectedGeometry = "Circular6+1"; // "Circular6+1", "Circular3+1", "Linear4", "Linear2" |
| 26 | +``` |
| 27 | + |
| 28 | +On Windows, the microphone array configuration is supplied by the audio driver. |
| 29 | + |
| 30 | +From v1.11.0, the Speech Devices SDK also supports configuration from a [JSON file](https://aka.ms/sdsdk-micarray-json). |
| 31 | + |
| 32 | + |
| 33 | +## Windows |
| 34 | +On Windows, the microphone array geometry information is automatically obtained from the audio driver. So, the properties `DeviceGeometry`, `SelectedGeometry`, and `MicArrayGeometryConfigFile` are optional. We use the [JSON file](https://aka.ms/sdsdk-micarray-json) provided using `MicArrayGeometryConfigFile` for only getting the beamforming range. |
| 35 | + |
| 36 | +If a microphone array is specified using `AudioConfig::FromMicrophoneInput`, then we use the specified microphone. If a microphone is not specified or `AudioConfig::FromDefaultMicrophoneInput` is called, then we use the default microphone, which is specified in Sound settings on Windows. |
| 37 | +The Microsoft Audio Stack in the Speech Devices SDK only supports down sampling for sample rates that are integral multiples of 16 KHz. |
| 38 | + |
| 39 | +## Linux |
| 40 | +On Linux, the microphone geometry information must be provided. The use of `DeviceGeometry` and `SelectedGeometry` remains supported. It can also be provided via the JSON file using the `MicArrayGeometryConfigFile` property. Similar to Windows, the beamforming range can be provided by the JSON file. |
| 41 | + |
| 42 | +If a microphone array is specified using `AudioConfig::FromMicrophoneInput`, then we use the specified microphone. If a microphone is not specified or `AudioConfig::FromDefaultMicrophoneInput` is called, then we record from ALSA device named *default*. By default, *default* always points to card 0 device 0, but users can change it in the `asound.conf` file. |
| 43 | + |
| 44 | +The Microsoft Audio Stack in the Speech Devices SDK only supports downsampling for sample rates that are integral multiples of 16 KHz. Additionally the following formats are supported: 32-bit IEEE little endian float, 32-bit little endian signed int, 24-bit little endian signed int, 16-bit little endian signed int, and 8-bit signed int. |
| 45 | + |
| 46 | +## Android |
| 47 | +Currently only [Roobo v1](speech-devices-sdk-android-quickstart.md) is supported by the Speech Devices SDK. Behavior is same as previous releases, except now `MicArrayGeometryConfigFile` property can be used to specify JSON file containing beamforming range. |
| 48 | + |
| 49 | +## Microphone Array Configuration JSON |
| 50 | + |
| 51 | +The JSON file for microphone array geometry configuration will follow the [JSON schema](https://aka.ms/sdsdk-micarray-json). Following are some examples that follow the schema. |
| 52 | + |
| 53 | + |
| 54 | +```json |
| 55 | +{ |
| 56 | + "micArrayType": "Linear", |
| 57 | + "geometry": "Linear4" |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +Or |
| 63 | + |
| 64 | + |
| 65 | +```json |
| 66 | +{ |
| 67 | + "micArrayType": "Planar", |
| 68 | + "horizontalAngleBegin": 0, |
| 69 | + "horizontalAngleEnd": 360, |
| 70 | + "numberOfMicrophones": 4, |
| 71 | + "micCoord": [ |
| 72 | + { |
| 73 | + "xCoord": 0, |
| 74 | + "yCoord": 0, |
| 75 | + "zCoord": 0 |
| 76 | + }, |
| 77 | + { |
| 78 | + "xCoord": 40, |
| 79 | + "yCoord": 0, |
| 80 | + "zCoord": 0 |
| 81 | + }, |
| 82 | + { |
| 83 | + "xCoord": -20, |
| 84 | + "yCoord": -35, |
| 85 | + "zCoord": 0 |
| 86 | + }, |
| 87 | + { |
| 88 | + "xCoord": -20, |
| 89 | + "yCoord": 35, |
| 90 | + "zCoord": 0 |
| 91 | + } |
| 92 | + ] |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +Or |
| 97 | + |
| 98 | +```json |
| 99 | +{ |
| 100 | + "micArrayType": "Linear", |
| 101 | + "horizontalAngleBegin": 70, |
| 102 | + "horizontalAngleEnd": 110 |
| 103 | +} |
| 104 | +``` |
| 105 | + |
| 106 | + |
| 107 | +## Next steps |
| 108 | + |
| 109 | +> [!div class="nextstepaction"] |
| 110 | +> [Choose your speech device](get-speech-devices-sdk.md) |
0 commit comments