How to work with Microphones
This topic provides basic information about microphone usage in games.
Supported Microphone Devices
The Microphone API is only implemented on OpenAL based platforms at this time. This includes iOS/Android and Desktop projects using DesktopGL.
Capabilities of the Microphone API
The MonoGame Microphone API has the following functionality:
- Captures the audio stream from a microphone.
- Submits and controls a stream of audio buffers for playback using the DynamicSoundEffectInstance object.
- Plays back audio.
Microphone API Process Workflow
The Microphone API behaves like a simple audio recorder with a configurable capture buffer. It has been designed with the following development process workflow:
- Select the microphone connected to the device.
- Configure the microphone's capture buffer size.
- Control the recording using standard transport controls (Start and Stop).
- Retrieve the captured audio using the GetData method.
Also, you can use the BufferReady event handler of the Microphone class if you want to be notified when the audio capture buffer is ready to be processed.
See Also
-
Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.
Reference
-
Provides properties, methods, and events for play back of the audio buffer.
-
Provides properties, methods, and fields and events for capturing audio data with microphones.