flet-audio-recorder 0.2.0.dev64__tar.gz → 0.70.0.dev6551__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {flet_audio_recorder-0.2.0.dev64/src/flet_audio_recorder.egg-info → flet_audio_recorder-0.70.0.dev6551}/PKG-INFO +14 -23
  2. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/README.md +9 -18
  3. flet_audio_recorder-0.70.0.dev6551/pyproject.toml +24 -0
  4. flet_audio_recorder-0.70.0.dev6551/src/flet_audio_recorder/audio_recorder.py +149 -0
  5. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551/src/flet_audio_recorder.egg-info}/PKG-INFO +14 -23
  6. flet_audio_recorder-0.70.0.dev6551/src/flet_audio_recorder.egg-info/requires.txt +1 -0
  7. flet_audio_recorder-0.70.0.dev6551/src/flutter/flet_audio_recorder/CHANGELOG.md +3 -0
  8. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/LICENSE +1 -1
  9. flet_audio_recorder-0.70.0.dev6551/src/flutter/flet_audio_recorder/README.md +3 -0
  10. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/pubspec.lock +101 -95
  11. flet_audio_recorder-0.70.0.dev6551/src/flutter/flet_audio_recorder/pubspec.yaml +23 -0
  12. flet_audio_recorder-0.2.0.dev64/pyproject.toml +0 -93
  13. flet_audio_recorder-0.2.0.dev64/src/flet_audio_recorder/audio_recorder.py +0 -254
  14. flet_audio_recorder-0.2.0.dev64/src/flet_audio_recorder.egg-info/requires.txt +0 -1
  15. flet_audio_recorder-0.2.0.dev64/src/flutter/flet_audio_recorder/CHANGELOG.md +0 -3
  16. flet_audio_recorder-0.2.0.dev64/src/flutter/flet_audio_recorder/README.md +0 -3
  17. flet_audio_recorder-0.2.0.dev64/src/flutter/flet_audio_recorder/pubspec.yaml +0 -23
  18. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/LICENSE +0 -0
  19. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/setup.cfg +0 -0
  20. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flet_audio_recorder/__init__.py +0 -0
  21. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flet_audio_recorder/types.py +0 -0
  22. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flet_audio_recorder.egg-info/SOURCES.txt +0 -0
  23. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flet_audio_recorder.egg-info/dependency_links.txt +0 -0
  24. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flet_audio_recorder.egg-info/top_level.txt +0 -0
  25. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/analysis_options.yaml +0 -0
  26. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/lib/flet_audio_recorder.dart +0 -0
  27. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/lib/src/audio_recorder.dart +0 -0
  28. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/lib/src/extension.dart +0 -0
  29. {flet_audio_recorder-0.2.0.dev64 → flet_audio_recorder-0.70.0.dev6551}/src/flutter/flet_audio_recorder/lib/src/utils/audio_recorder.dart +0 -0
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-audio-recorder
3
- Version: 0.2.0.dev64
3
+ Version: 0.70.0.dev6551
4
4
  Summary: Adds audio recording support to Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://flet.dev
8
- Project-URL: Documentation, https://flet-dev.github.io/flet-audio-recorder
9
- Project-URL: Repository, https://github.com/flet-dev/flet-audio-recorder
10
- Project-URL: Issues, https://github.com/flet-dev/flet-audio-recorder/issues
8
+ Project-URL: Documentation, https://docs.flet.dev/audio-recorder
9
+ Project-URL: Repository, https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-audio-recorder
10
+ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: flet>=0.70.0.dev0
14
+ Requires-Dist: flet==0.70.0.dev6551
15
15
  Dynamic: license-file
16
16
 
17
17
  # flet-audio-recorder
18
18
 
19
19
  [![pypi](https://img.shields.io/pypi/v/flet-audio-recorder.svg)](https://pypi.python.org/pypi/flet-audio-recorder)
20
20
  [![downloads](https://static.pepy.tech/badge/flet-audio-recorder/month)](https://pepy.tech/project/flet-audio-recorder)
21
- [![license](https://img.shields.io/github/license/flet-dev/flet-audio-recorder.svg)](https://github.com/flet-dev/flet-audio-recorder/blob/main/LICENSE)
21
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio-recorder/LICENSE)
22
22
 
23
23
  Adds audio recording support to [Flet](https://flet.dev) apps.
24
24
 
@@ -26,22 +26,17 @@ It is based on the [record](https://pub.dev/packages/record) Flutter package.
26
26
 
27
27
  ## Documentation
28
28
 
29
- Detailed documentation to this package can be found [here](https://flet-dev.github.io/flet-audio-recorder/).
29
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/audio-recorder/).
30
30
 
31
31
  ## Platform Support
32
32
 
33
- This package supports the following platforms:
33
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
34
+ |----------|---------|-------|-------|-----|---------|-----|
35
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
34
36
 
35
- | Platform | Supported |
36
- |----------|:---------:|
37
- | Windows | ✅ |
38
- | macOS | ✅ |
39
- | Linux | ✅ |
40
- | iOS | ✅ |
41
- | Android | ✅ |
42
- | Web | ✅ |
37
+ ## Usage
43
38
 
44
- ## Installation
39
+ ### Installation
45
40
 
46
41
  To install the `flet-audio-recorder` package and add it to your project dependencies:
47
42
 
@@ -56,14 +51,10 @@ To install the `flet-audio-recorder` package and add it to your project dependen
56
51
  ```
57
52
  After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
58
53
 
59
- - Using `poetry`:
60
- ```bash
61
- poetry add flet-audio-recorder
62
- ```
63
54
 
64
55
  > [!NOTE]
65
56
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
66
57
 
67
- ## Examples
58
+ ### Examples
68
59
 
69
- For examples, see [this](./examples)
60
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/audio_recorder).
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![pypi](https://img.shields.io/pypi/v/flet-audio-recorder.svg)](https://pypi.python.org/pypi/flet-audio-recorder)
4
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)
5
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio-recorder/LICENSE)
6
6
 
7
7
  Adds audio recording support to [Flet](https://flet.dev) apps.
8
8
 
@@ -10,22 +10,17 @@ It is based on the [record](https://pub.dev/packages/record) Flutter package.
10
10
 
11
11
  ## Documentation
12
12
 
13
- Detailed documentation to this package can be found [here](https://flet-dev.github.io/flet-audio-recorder/).
13
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/audio-recorder/).
14
14
 
15
15
  ## Platform Support
16
16
 
17
- This package supports the following platforms:
17
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
18
+ |----------|---------|-------|-------|-----|---------|-----|
19
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
18
20
 
19
- | Platform | Supported |
20
- |----------|:---------:|
21
- | Windows | ✅ |
22
- | macOS | ✅ |
23
- | Linux | ✅ |
24
- | iOS | ✅ |
25
- | Android | ✅ |
26
- | Web | ✅ |
21
+ ## Usage
27
22
 
28
- ## Installation
23
+ ### Installation
29
24
 
30
25
  To install the `flet-audio-recorder` package and add it to your project dependencies:
31
26
 
@@ -40,14 +35,10 @@ To install the `flet-audio-recorder` package and add it to your project dependen
40
35
  ```
41
36
  After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
42
37
 
43
- - Using `poetry`:
44
- ```bash
45
- poetry add flet-audio-recorder
46
- ```
47
38
 
48
39
  > [!NOTE]
49
40
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
50
41
 
51
- ## Examples
42
+ ### Examples
52
43
 
53
- For examples, see [this](./examples)
44
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/audio_recorder).
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "flet-audio-recorder"
3
+ version = "0.70.0.dev6551"
4
+ description = "Adds audio recording support to Flet apps."
5
+ readme = "README.md"
6
+ authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
+ license = "Apache-2.0"
8
+ requires-python = ">=3.10"
9
+ dependencies = [
10
+ "flet==0.70.0.dev6551",
11
+ ]
12
+
13
+ [project.urls]
14
+ Homepage = "https://flet.dev"
15
+ Documentation = "https://docs.flet.dev/audio-recorder"
16
+ Repository = "https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-audio-recorder"
17
+ Issues = "https://github.com/flet-dev/flet/issues"
18
+
19
+ [tool.setuptools.package-data]
20
+ "flutter.flet_audio_recorder" = ["**/*"]
21
+
22
+ [build-system]
23
+ requires = ["setuptools"]
24
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,149 @@
1
+ from dataclasses import field
2
+ from typing import Optional
3
+
4
+ import flet as ft
5
+
6
+ from .types import (
7
+ AudioEncoder,
8
+ AudioRecorderConfiguration,
9
+ AudioRecorderStateChangeEvent,
10
+ InputDevice,
11
+ )
12
+
13
+ __all__ = ["AudioRecorder"]
14
+
15
+
16
+ @ft.control("AudioRecorder")
17
+ class AudioRecorder(ft.Service):
18
+ """
19
+ A control that allows you to record audio from your device.
20
+
21
+ This control can record audio using different
22
+ audio encoders and also allows configuration
23
+ of various audio recording parameters such as
24
+ noise suppression, echo cancellation, and more.
25
+ """
26
+
27
+ configuration: AudioRecorderConfiguration = field(
28
+ default_factory=lambda: AudioRecorderConfiguration()
29
+ )
30
+ """
31
+ The default configuration of the audio recorder.
32
+ """
33
+
34
+ on_state_change: Optional[ft.EventHandler[AudioRecorderStateChangeEvent]] = None
35
+ """
36
+ Event handler that is called when the state of the audio recorder changes.
37
+ """
38
+
39
+ async def start_recording(
40
+ self,
41
+ output_path: Optional[str] = None,
42
+ configuration: Optional[AudioRecorderConfiguration] = None,
43
+ ) -> bool:
44
+ """
45
+ Starts recording audio and saves it to the specified output path.
46
+
47
+ If not on the web, the `output_path` parameter must be provided.
48
+
49
+ Args:
50
+ output_path: The file path where the audio will be saved.
51
+ It must be specified if not on web.
52
+ configuration: The configuration for the audio recorder.
53
+ If `None`, the `AudioRecorder.configuration` will be used.
54
+
55
+ Returns:
56
+ `True` if recording was successfully started, `False` otherwise.
57
+
58
+ Raises:
59
+ ValueError: If `output_path` is not provided on platforms other than web.
60
+ """
61
+ if not (self.page.web or output_path):
62
+ raise ValueError("output_path must be provided on platforms other than web")
63
+ return await self._invoke_method(
64
+ method_name="start_recording",
65
+ arguments={
66
+ "output_path": output_path,
67
+ "configuration": configuration
68
+ if configuration is not None
69
+ else self.configuration,
70
+ },
71
+ )
72
+
73
+ async def is_recording(self) -> bool:
74
+ """
75
+ Checks whether the audio recorder is currently recording.
76
+
77
+ Returns:
78
+ `True` if the recorder is currently recording, `False` otherwise.
79
+ """
80
+ return await self._invoke_method("is_recording")
81
+
82
+ async def stop_recording(self) -> Optional[str]:
83
+ """
84
+ Stops the audio recording and optionally returns the path to the saved file.
85
+
86
+ Returns:
87
+ The file path where the audio was saved or `None` if not applicable.
88
+ """
89
+ return await self._invoke_method("stop_recording")
90
+
91
+ async def cancel_recording(self):
92
+ """
93
+ Cancels the current audio recording.
94
+ """
95
+ await self._invoke_method("cancel_recording")
96
+
97
+ async def resume_recording(self):
98
+ """
99
+ Resumes a paused audio recording.
100
+ """
101
+ await self._invoke_method("resume_recording")
102
+
103
+ async def pause_recording(self):
104
+ """
105
+ Pauses the ongoing audio recording.
106
+ """
107
+ await self._invoke_method("pause_recording")
108
+
109
+ async def is_paused(self) -> bool:
110
+ """
111
+ Checks whether the audio recorder is currently paused.
112
+
113
+ Returns:
114
+ `True` if the recorder is paused, `False` otherwise.
115
+ """
116
+ return await self._invoke_method("is_paused")
117
+
118
+ async def is_supported_encoder(self, encoder: AudioEncoder) -> bool:
119
+ """
120
+ Checks if the given audio encoder is supported by the recorder.
121
+
122
+ Args:
123
+ encoder: The audio encoder to check.
124
+
125
+ Returns:
126
+ `True` if the encoder is supported, `False` otherwise.
127
+ """
128
+ return await self._invoke_method("is_supported_encoder", {"encoder": encoder})
129
+
130
+ async def get_input_devices(self) -> list[InputDevice]:
131
+ """
132
+ Retrieves the available input devices for recording.
133
+
134
+ Returns:
135
+ A list of available input devices.
136
+ """
137
+ r = await self._invoke_method("get_input_devices")
138
+ return [
139
+ InputDevice(id=device_id, label=label) for device_id, label in r.items()
140
+ ]
141
+
142
+ async def has_permission(self) -> bool:
143
+ """
144
+ Checks if the app has permission to record audio.
145
+
146
+ Returns:
147
+ `True` if the app has permission, `False` otherwise.
148
+ """
149
+ return await self._invoke_method("has_permission")
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-audio-recorder
3
- Version: 0.2.0.dev64
3
+ Version: 0.70.0.dev6551
4
4
  Summary: Adds audio recording support to Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://flet.dev
8
- Project-URL: Documentation, https://flet-dev.github.io/flet-audio-recorder
9
- Project-URL: Repository, https://github.com/flet-dev/flet-audio-recorder
10
- Project-URL: Issues, https://github.com/flet-dev/flet-audio-recorder/issues
8
+ Project-URL: Documentation, https://docs.flet.dev/audio-recorder
9
+ Project-URL: Repository, https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-audio-recorder
10
+ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: flet>=0.70.0.dev0
14
+ Requires-Dist: flet==0.70.0.dev6551
15
15
  Dynamic: license-file
16
16
 
17
17
  # flet-audio-recorder
18
18
 
19
19
  [![pypi](https://img.shields.io/pypi/v/flet-audio-recorder.svg)](https://pypi.python.org/pypi/flet-audio-recorder)
20
20
  [![downloads](https://static.pepy.tech/badge/flet-audio-recorder/month)](https://pepy.tech/project/flet-audio-recorder)
21
- [![license](https://img.shields.io/github/license/flet-dev/flet-audio-recorder.svg)](https://github.com/flet-dev/flet-audio-recorder/blob/main/LICENSE)
21
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio-recorder/LICENSE)
22
22
 
23
23
  Adds audio recording support to [Flet](https://flet.dev) apps.
24
24
 
@@ -26,22 +26,17 @@ It is based on the [record](https://pub.dev/packages/record) Flutter package.
26
26
 
27
27
  ## Documentation
28
28
 
29
- Detailed documentation to this package can be found [here](https://flet-dev.github.io/flet-audio-recorder/).
29
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/audio-recorder/).
30
30
 
31
31
  ## Platform Support
32
32
 
33
- This package supports the following platforms:
33
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
34
+ |----------|---------|-------|-------|-----|---------|-----|
35
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
34
36
 
35
- | Platform | Supported |
36
- |----------|:---------:|
37
- | Windows | ✅ |
38
- | macOS | ✅ |
39
- | Linux | ✅ |
40
- | iOS | ✅ |
41
- | Android | ✅ |
42
- | Web | ✅ |
37
+ ## Usage
43
38
 
44
- ## Installation
39
+ ### Installation
45
40
 
46
41
  To install the `flet-audio-recorder` package and add it to your project dependencies:
47
42
 
@@ -56,14 +51,10 @@ To install the `flet-audio-recorder` package and add it to your project dependen
56
51
  ```
57
52
  After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
58
53
 
59
- - Using `poetry`:
60
- ```bash
61
- poetry add flet-audio-recorder
62
- ```
63
54
 
64
55
  > [!NOTE]
65
56
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
66
57
 
67
- ## Examples
58
+ ### Examples
68
59
 
69
- For examples, see [this](./examples)
60
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/audio_recorder).
@@ -0,0 +1,3 @@
1
+ # 0.1.0
2
+
3
+ Initial release of the package.
@@ -198,4 +198,4 @@
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
- limitations under the License.
201
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ # Flet `AudioRecorder` control
2
+
3
+ `AudioRecorder` control to use in Flet apps.