website/docs/services/audiorecorder/index.md
import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import {ClassAll, CodeExample} from '@site/src/components/crocodocs';
Allows recording audio in Flet apps.
It is based on the record Flutter package.
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|---|---|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
To use AudioRecorder service add flet-audio-recorder package to your project dependencies:
requirements.txt or pyproject.toml.
</TabItem>
The below sections show the required configurations for each platform.
Configuration to be made to access the microphone:
android.permission.RECORD_AUDIO: Allows audio recording.android.permission.WRITE_EXTERNAL_STORAGE (optional): Allows saving your recordings in public folders.android.permission.MODIFY_AUDIO_SETTINGS (optional): Allows using bluetooth telephony device like headset/earbuds.Configuration to be made to access the microphone:
NSMicrophoneUsageDescription: Required for recording audio.Configuration to be made to access the microphone:
NSMicrophoneUsageDescription: Allows recording audio.com.apple.security.device.audio-input: Allows recording audio using the built-in microphone and accessing audio input using Core Audio.[tool.flet.macos.entitlement] "com.apple.security.device.audio-input" = true
</TabItem>
</Tabs>
See also:
- [setting macOS permissions](../../publish/macos.md#permissions)
- [setting macOS entitlements](../../publish/macos.md#entitlements)
### Linux
The following dependencies are required (and widely available on your system):
- `parecord`: Used for audio input.
- `pactl`: Used for utility methods like getting available devices.
- [`ffmpeg`](https://ffmpeg.org): Used for encoding and output.
On Ubuntu 24.04.3 LTS, you can install them using:
```bash
sudo apt install pulseaudio-utils ffmpeg
Additionally/alternatively, you can make use of our predefined cross-platform microphone
permission bundle:
<CodeExample path={frontMatter.examples + '/example_1/main.py'} language="python" />