AudioRecorder
Allows recording audio in Flet apps.
Platform Support
| Platform | Windows | macOS | Linux | iOS | Android | Web | |---|---|---|---|---|---|---| | Supported | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Installation
Add flet-audio-recorder to project dependencies:
uv add flet-audio-recorder
or
pip install flet-audio-recorder
**Note:** For Linux, fmedia must be installed separately.
Description
Inherits from flet.Service. Provides functionality to record audio with configurable parameters.
Properties
configuration**: AudioRecorderConfigurationEvents
on_state_change**: EventHandler[AudioRecorderStateChangeEvent] | NoneMethods
cancel_recording()** (async)get_input_devices()** (async) -> list[InputDevice]has_permission()** (async) -> boolis_paused()** (async) -> boolTrue if the recorder is currently paused, False otherwise.is_recording()** (async) -> boolTrue if the recorder is currently recording, False otherwise.is_supported_encoder(encoder: AudioEncoder)** (async) -> boolpause_recording()** (async)resume_recording()** (async)start_recording(output_path: str | None = None, configuration: AudioRecorderConfiguration | None = None)** (async) -> booloutput_path: Required on non-web platforms. Path to save the audio file.
* configuration: Optional. Overrides the default configuration.
* Returns True if started successfully, False otherwise.
* Raises ValueError if output_path is missing on non-web.stop_recording()** (async) -> str | NoneNone.
Previous
arrow_back
Releasemode