Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 7cc2121

Browse files
authored
Merge pull request #3 from flet-dev/v1
flet-audio-recorder v1
2 parents 1d89741 + 1fd4842 commit 7cc2121

37 files changed

Lines changed: 1130 additions & 2276 deletions

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'LICENSE'
9+
- 'CHANGELOG.md'
10+
- 'docs/**'
11+
- 'mkdocs.yml'
12+
- 'pyproject.toml'
13+
- '.github/workflows/docs.yml'
14+
- 'src/flet_audio_recorder/**'
15+
- 'examples/audio_recorder_example/src/**'
16+
17+
workflow_dispatch: # Allow manual trigger from the GitHub Actions UI
18+
19+
concurrency:
20+
group: "docs" # Prevent multiple overlapping deploys
21+
cancel-in-progress: false # Allow in-progress deploys to finish
22+
23+
permissions:
24+
contents: write # Required to push to the gh-pages branch
25+
26+
env:
27+
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Token used by mkdocs for pushing
28+
UV_SYSTEM_PYTHON: 1 # Use system Python interpreter with uv
29+
30+
jobs:
31+
deploy:
32+
name: Deploy Documentation
33+
runs-on: ubuntu-latest
34+
if: github.repository == github.event.repository.full_name # don't run on forks
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Configure Git for mkdocs
40+
run: |
41+
git config user.name github-actions[bot]
42+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
43+
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v6
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version-file: "pyproject.toml" # Match Python version with project config
51+
52+
- name: Install dependencies
53+
run: |
54+
uv pip install -e .
55+
uv pip install --group docs
56+
57+
- name: Deploy to GitHub Pages
58+
run: uv run mkdocs gh-deploy --force

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ develop-eggs/
44
dist/
55
.DS_store
66
/site
7+
.venv/

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 5.13.2
4+
hooks:
5+
- id: isort
6+
- repo: https://github.com/ambv/black
7+
rev: 22.12.0
8+
hooks:
9+
- id: black

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7+
8+
## [0.2.0] - 2025-06-26
9+
10+
### Added
11+
12+
- Deployed online documentation: https://flet-dev.github.io/flet-audiorecorder/
13+
- `AudioRecorder` control new property: `configuration`
14+
- New dataclasses:
15+
- `AudioRecorderConfiguration`
16+
- `AndroidRecorderConfiguration`
17+
- `IosRecorderConfiguration`
18+
- `InputDevice`
19+
- New enums:
20+
- `AndroidAudioSource`
21+
- `IosAudioCategoryOption`
22+
23+
### Changed
24+
25+
- Refactored `AudioRecorder` control to use `@ft.control` dataclass-style definition and switched to `Service` control type
26+
27+
#### Breaking Changes
28+
29+
- `AudioRecorder` must now be added to `Page.services` instead of `Page.overlay`.
30+
- Recording configuration properties (`audio_encoder`, `suppress_noise`, `cancel_echo`, `auto_gain`, `channels_num`, `sample_rate`, `bit_rate`) are now grouped under `configuration: AudioRecorderConfiguration`
31+
- Event `on_state_changed` renamed to `on_state_change`
32+
- In all methods, parameter `wait_timeout` was renamed to `timeout`.
33+
- The following sync methods were removed from `AudioRecorder` (use corresponding async methods instead):
34+
- `is_recording``is_recording_async`
35+
- `stop_recording``stop_recording_async`
36+
- `cancel_recording``cancel_recording_async`
37+
- `resume_recording``resume_recording_async`
38+
- `pause_recording``pause_recording_async`
39+
- `is_paused``is_paused_async`
40+
- `is_supported_encoder``is_supported_encoder_async`
41+
- `get_input_devices``get_input_devices_async`
42+
- `has_permission``has_permission_async`
43+
44+
## [0.1.0] - 2025-01-15
45+
46+
Initial release.
47+
48+
49+
[0.2.0]: https://github.com/flet-dev/flet-audio-recorder/compare/0.1.0...0.2.0
50+
[0.1.0]: https://github.com/flet-dev/flet-audio-recorder/releases/tag/0.1.0

README.md

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,53 @@
1-
# AudioRecorder
1+
# flet-audio-recorder
22

3-
Audio recorder from microphone to a given file path. Works on macOS, Linux, Windows, iOS, Android and web.
4-
Based on the [record](https://pub.dev/packages/record) Dart/Flutter package.
3+
[![pypi](https://img.shields.io/pypi/v/flet-audio-recorder.svg)](https://pypi.python.org/pypi/flet-audio-recorder)
4+
[![downloads](https://static.pepy.tech/badge/flet-audio-recorder/month)](https://pepy.tech/project/flet-audio-recorder)
5+
[![license](https://img.shields.io/github/license/flet-dev/flet-audio-recorder.svg)](https://github.com/flet-dev/flet-audio-recorder/blob/main/LICENSE)
56

6-
**NOTE:** On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
7+
Adds audio recording support to [Flet](https://flet.dev) apps.
78

8-
AudioRecorder control is non-visual and should be added to `page.overlay` list.
9+
It is based on the [record](https://pub.dev/packages/record) Flutter package.
10+
11+
## Documentation
12+
13+
Detailed documentation to this package can be found [here](https://flet-dev.github.io/flet-audio-recorder/).
14+
15+
## Platform Support
16+
17+
This package supports the following platforms:
18+
19+
| Platform | Supported |
20+
|----------|:---------:|
21+
| Windows ||
22+
| macOS ||
23+
| Linux ||
24+
| iOS ||
25+
| Android ||
26+
| Web ||
927

1028
## Installation
1129

12-
Add `flet-audio-recorder` as dependency to `pyproject.toml` of your Flet app:
30+
To install the `flet-audio-recorder` package and add it to your project dependencies:
1331

14-
```
15-
dependencies = [
16-
"flet-audio-recorder",
17-
"flet>=0.27.4",
18-
]
19-
```
32+
- Using `uv`:
33+
```bash
34+
uv add flet-audio-recorder
35+
```
2036

21-
## Documentation
37+
- Using `pip`:
38+
```bash
39+
pip install flet-audio-recorder
40+
```
41+
After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
42+
43+
- Using `poetry`:
44+
```bash
45+
poetry add flet-audio-recorder
46+
```
47+
48+
> [!NOTE]
49+
> On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
50+
51+
## Examples
2252

23-
https://flet-dev.github.io/flet-audio-recorder/
53+
For examples, see [this](./examples)

docs/audio_recorder.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: flet_audio_recorder.audio_recorder.AudioRecorder

docs/audioencoder.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/audiorecorder.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/audiorecorderstate.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/audiorecorderstatechangeevent.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)