flet-audio-recorder 0.2.0.dev55__tar.gz → 0.2.0.dev69__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.

Potentially problematic release.


This version of flet-audio-recorder might be problematic. Click here for more details.

Files changed (23) hide show
  1. {flet_audio_recorder-0.2.0.dev55/src/flet_audio_recorder.egg-info → flet_audio_recorder-0.2.0.dev69}/PKG-INFO +6 -4
  2. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/README.md +5 -3
  3. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/pyproject.toml +40 -14
  4. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder/__init__.py +13 -0
  5. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder/audio_recorder.py +49 -63
  6. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder/types.py +59 -42
  7. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69/src/flet_audio_recorder.egg-info}/PKG-INFO +6 -4
  8. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/pubspec.lock +66 -50
  9. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/pubspec.yaml +1 -1
  10. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/LICENSE +0 -0
  11. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/setup.cfg +0 -0
  12. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder.egg-info/SOURCES.txt +0 -0
  13. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder.egg-info/dependency_links.txt +0 -0
  14. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder.egg-info/requires.txt +0 -0
  15. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flet_audio_recorder.egg-info/top_level.txt +0 -0
  16. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/CHANGELOG.md +0 -0
  17. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/LICENSE +0 -0
  18. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/README.md +0 -0
  19. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/analysis_options.yaml +0 -0
  20. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/lib/flet_audio_recorder.dart +0 -0
  21. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/lib/src/audio_recorder.dart +0 -0
  22. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/lib/src/extension.dart +0 -0
  23. {flet_audio_recorder-0.2.0.dev55 → flet_audio_recorder-0.2.0.dev69}/src/flutter/flet_audio_recorder/lib/src/utils/audio_recorder.dart +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-audio-recorder
3
- Version: 0.2.0.dev55
3
+ Version: 0.2.0.dev69
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
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ✅ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-audio-recorder` package and add it to your project dependencies:
47
49
 
@@ -64,6 +66,6 @@ To install the `flet-audio-recorder` package and add it to your project dependen
64
66
  > [!NOTE]
65
67
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
66
68
 
67
- ## Examples
69
+ ### Examples
68
70
 
69
- For examples, see [this](./examples)
71
+ For examples, see [these](./examples).
@@ -25,7 +25,9 @@ This package supports the following platforms:
25
25
  | Android | ✅ |
26
26
  | Web | ✅ |
27
27
 
28
- ## Installation
28
+ ## Usage
29
+
30
+ ### Installation
29
31
 
30
32
  To install the `flet-audio-recorder` package and add it to your project dependencies:
31
33
 
@@ -48,6 +50,6 @@ To install the `flet-audio-recorder` package and add it to your project dependen
48
50
  > [!NOTE]
49
51
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
50
52
 
51
- ## Examples
53
+ ### Examples
52
54
 
53
- For examples, see [this](./examples)
55
+ For examples, see [these](./examples).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flet-audio-recorder"
3
- version = "0.2.0.dev55"
3
+ version = "0.2.0.dev69"
4
4
  description = "Adds audio recording support to Flet apps."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
@@ -20,23 +20,48 @@ Issues = "https://github.com/flet-dev/flet-audio-recorder/issues"
20
20
  "flutter.flet_audio_recorder" = ["**/*"]
21
21
 
22
22
  [dependency-groups]
23
+ test = [
24
+ "pytest >=7.2.0",
25
+ ]
26
+ lint = [
27
+ "ruff >=0.11.7",
28
+ ]
23
29
  dev = [
24
- "pre-commit>=4.2.0",
25
- "ruff>=0.11.7",
30
+ "pre-commit >=4.2.0",
31
+ { include-group = 'lint' },
32
+ { include-group = 'test' },
33
+ ]
34
+ docs-coverage = [
35
+ "docstr-coverage >=2.3.2",
26
36
  ]
27
37
  docs = [
28
- "mkdocs",
29
- "mkdocs-material",
30
- "mkdocstrings[python]",
31
- "mkdocstrings-python-xref",
32
- "mike",
33
- "markdown>=3.6",
34
- "pymdown-extensions",
35
- "mkdocs-glightbox",
36
- "mkdocs-section-index",
37
- "griffe-modernized-annotations",
38
- "pygments>=2.16",
38
+ "mkdocs >=1.6.1",
39
+ "mkdocs-material >=9.6.15",
40
+ "mkdocstrings-python >=1.16.12",
41
+ "mkdocstrings-python-xref >=1.16.3",
42
+ "mike >=2.1.3",
43
+ "markdown >=3.6",
44
+ "pymdown-extensions >=10.16",
45
+ "mkdocs-exclude >=1.0.2",
46
+ "mkdocs-glightbox >=0.4.0",
47
+ "mkdocs-open-in-new-tab >=1.0.8",
48
+ "mkdocs-section-index >=0.3.10",
49
+ "griffe-modernized-annotations >=1.0.8",
50
+ "griffe-warnings-deprecated >=1.1.0",
51
+ "pygments >=2.16",
52
+ "markdown-exec[ansi] >=1.11.0",
53
+ "pydocstyle >=6.3.0",
54
+ "linkcheckmd >=1.4.0",
55
+ "mkdocs-external-images",
56
+ { include-group = 'docs-coverage' },
39
57
  ]
58
+ all = [
59
+ { include-group = 'dev' },
60
+ { include-group = 'docs' },
61
+ ]
62
+
63
+ [tool.uv.sources]
64
+ mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }
40
65
 
41
66
  [build-system]
42
67
  requires = ["setuptools"]
@@ -64,6 +89,7 @@ select = [
64
89
  "I"
65
90
  ]
66
91
  preview = true
92
+ pydocstyle = { convention = 'google' }
67
93
 
68
94
  [tool.ruff.format]
69
95
  quote-style = "double"
@@ -10,3 +10,16 @@ from .types import (
10
10
  IosAudioCategoryOption,
11
11
  IosRecorderConfiguration,
12
12
  )
13
+
14
+ __all__ = [
15
+ "AndroidAudioSource",
16
+ "AndroidRecorderConfiguration",
17
+ "AudioEncoder",
18
+ "AudioRecorder",
19
+ "AudioRecorderConfiguration",
20
+ "AudioRecorderState",
21
+ "AudioRecorderStateChangeEvent",
22
+ "InputDevice",
23
+ "IosAudioCategoryOption",
24
+ "IosRecorderConfiguration",
25
+ ]
@@ -1,6 +1,5 @@
1
- import asyncio
2
1
  from dataclasses import field
3
- from typing import List, Optional
2
+ from typing import Optional
4
3
 
5
4
  import flet as ft
6
5
 
@@ -19,11 +18,14 @@ class AudioRecorder(ft.Service):
19
18
  """
20
19
  A control that allows you to record audio from your device.
21
20
 
22
- This control can record audio using different audio encoders and also allows configuration
23
- of various audio recording parameters such as noise suppression, echo cancellation, and more.
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.
24
25
 
25
26
  Note:
26
- This control is non-visual and should be added to `Page.services` list before it can be used.
27
+ This control is non-visual and should be added to
28
+ [`Page.services`][flet.Page.services] list before it can be used.
27
29
  """
28
30
 
29
31
  configuration: AudioRecorderConfiguration = field(
@@ -33,16 +35,12 @@ class AudioRecorder(ft.Service):
33
35
  The default configuration of the audio recorder.
34
36
  """
35
37
 
36
- on_state_change: ft.OptionalEventHandler[
37
- AudioRecorderStateChangeEvent["AudioRecorder"]
38
- ] = None
38
+ on_state_change: Optional[ft.EventHandler[AudioRecorderStateChangeEvent]] = None
39
39
  """
40
40
  Event handler that is called when the state of the audio recorder changes.
41
-
42
- Event handler argument is of type [`AudioRecorderStateChangeEvent`][(p).].
43
41
  """
44
42
 
45
- async def start_recording_async(
43
+ async def start_recording(
46
44
  self,
47
45
  output_path: Optional[str] = None,
48
46
  configuration: Optional[AudioRecorderConfiguration] = None,
@@ -59,15 +57,17 @@ class AudioRecorder(ft.Service):
59
57
  configuration: The configuration for the audio recorder.
60
58
  If `None`, the `AudioRecorder.configuration` will be used.
61
59
  timeout: The maximum amount of time (in seconds) to wait for a response.
60
+
62
61
  Returns:
63
62
  `True` if recording was successfully started, `False` otherwise.
63
+
64
64
  Raises:
65
65
  TimeoutError: If the request times out.
66
66
  """
67
- assert (
68
- self.page.web or output_path
69
- ), "output_path must be provided on platforms other than web"
70
- return await self._invoke_method_async(
67
+ assert self.page.web or output_path, (
68
+ "output_path must be provided on platforms other than web"
69
+ )
70
+ return await self._invoke_method(
71
71
  method_name="start_recording",
72
72
  arguments={
73
73
  "output_path": output_path,
@@ -78,152 +78,138 @@ class AudioRecorder(ft.Service):
78
78
  timeout=timeout,
79
79
  )
80
80
 
81
- async def is_recording_async(self, timeout: Optional[float] = 10) -> bool:
81
+ async def is_recording(self, timeout: Optional[float] = 10) -> bool:
82
82
  """
83
83
  Checks whether the audio recorder is currently recording.
84
84
 
85
85
  Args:
86
86
  timeout: The maximum amount of time (in seconds) to wait for a response.
87
+
87
88
  Returns:
88
89
  `True` if the recorder is currently recording, `False` otherwise.
90
+
89
91
  Raises:
90
92
  TimeoutError: If the request times out.
91
93
  """
92
- return await self._invoke_method_async("is_recording", timeout=timeout)
94
+ return await self._invoke_method("is_recording", timeout=timeout)
93
95
 
94
- async def stop_recording_async(self, timeout: Optional[float] = 10) -> Optional[str]:
96
+ async def stop_recording(self, timeout: Optional[float] = 10) -> Optional[str]:
95
97
  """
96
98
  Stops the audio recording and optionally returns the path to the saved file.
97
99
 
98
100
  Args:
99
101
  timeout: The maximum amount of time (in seconds) to wait for a response.
102
+
100
103
  Returns:
101
104
  The file path where the audio was saved or `None` if not applicable.
102
- Raises:
103
- TimeoutError: If the request times out.
104
- """
105
- return await self._invoke_method_async("stop_recording", timeout=timeout)
106
-
107
- async def cancel_recording_async(self, timeout: Optional[float] = 10):
108
- """
109
- Cancels the current audio recording.
110
105
 
111
- Args:
112
- timeout: The maximum amount of time (in seconds) to wait for a response.
113
106
  Raises:
114
107
  TimeoutError: If the request times out.
115
108
  """
116
- await self._invoke_method_async("cancel_recording", timeout=timeout)
109
+ return await self._invoke_method("stop_recording", timeout=timeout)
117
110
 
118
- def cancel_recording(self, timeout: Optional[float] = 10):
111
+ async def cancel_recording(self, timeout: Optional[float] = 10):
119
112
  """
120
113
  Cancels the current audio recording.
121
114
 
122
115
  Args:
123
116
  timeout: The maximum amount of time (in seconds) to wait for a response.
124
- Raises:
125
- TimeoutError: If the request times out.
126
- """
127
- asyncio.create_task(self.cancel_recording_async(timeout=timeout))
128
-
129
- async def resume_recording_async(self, timeout: Optional[float] = 10):
130
- """
131
- Resumes a paused audio recording.
132
117
 
133
- Args:
134
- timeout: The maximum amount of time (in seconds) to wait for a response.
135
118
  Raises:
136
119
  TimeoutError: If the request times out.
137
120
  """
138
- await self._invoke_method_async("resume_recording", timeout=timeout)
121
+ await self._invoke_method("cancel_recording", timeout=timeout)
139
122
 
140
- def resume_recording(self, timeout: Optional[float] = 10):
123
+ async def resume_recording(self, timeout: Optional[float] = 10):
141
124
  """
142
125
  Resumes a paused audio recording.
143
126
 
144
127
  Args:
145
128
  timeout: The maximum amount of time (in seconds) to wait for a response.
146
- Raises:
147
- TimeoutError: If the request times out.
148
- """
149
- asyncio.create_task(self.resume_recording_async(timeout=timeout))
150
129
 
151
- async def pause_recording_async(self, timeout: Optional[float] = 10):
152
- """
153
- Pauses the ongoing audio recording.
154
-
155
- Args:
156
- timeout: The maximum amount of time (in seconds) to wait for a response.
157
130
  Raises:
158
131
  TimeoutError: If the request times out.
159
132
  """
160
- await self._invoke_method_async("pause_recording", timeout=timeout)
133
+ await self._invoke_method("resume_recording", timeout=timeout)
161
134
 
162
- def pause_recording(self, timeout: Optional[float] = 10):
135
+ async def pause_recording(self, timeout: Optional[float] = 10):
163
136
  """
164
137
  Pauses the ongoing audio recording.
165
138
 
166
139
  Args:
167
140
  timeout: The maximum amount of time (in seconds) to wait for a response.
141
+
168
142
  Raises:
169
143
  TimeoutError: If the request times out.
170
144
  """
171
- asyncio.create_task(self.pause_recording_async(timeout=timeout))
145
+ await self._invoke_method("pause_recording", timeout=timeout)
172
146
 
173
- async def is_paused_async(self, timeout: Optional[float] = 10) -> bool:
147
+ async def is_paused(self, timeout: Optional[float] = 10) -> bool:
174
148
  """
175
149
  Checks whether the audio recorder is currently paused.
176
150
 
177
151
  Args:
178
152
  timeout: The maximum amount of time (in seconds) to wait for a response.
153
+
179
154
  Returns:
180
155
  `True` if the recorder is paused, `False` otherwise.
156
+
181
157
  Raises:
182
158
  TimeoutError: If the request times out.
183
159
  """
184
- return await self._invoke_method_async("is_paused", timeout=timeout)
160
+ return await self._invoke_method("is_paused", timeout=timeout)
185
161
 
186
- async def is_supported_encoder_async(self, encoder: AudioEncoder, timeout: Optional[float] = 10) -> bool:
162
+ async def is_supported_encoder(
163
+ self, encoder: AudioEncoder, timeout: Optional[float] = 10
164
+ ) -> bool:
187
165
  """
188
166
  Checks if the given audio encoder is supported by the recorder.
189
167
 
190
168
  Args:
191
169
  encoder: The audio encoder to check.
192
170
  timeout: The maximum amount of time (in seconds) to wait for a response.
171
+
193
172
  Returns:
194
173
  `True` if the encoder is supported, `False` otherwise.
174
+
195
175
  Raises:
196
176
  TimeoutError: If the request times out.
197
177
  """
198
- return await self._invoke_method_async(
178
+ return await self._invoke_method(
199
179
  "is_supported_encoder", {"encoder": encoder}, timeout=timeout
200
180
  )
201
181
 
202
- async def get_input_devices_async(self, timeout: Optional[float] = 10) -> List[InputDevice]:
182
+ async def get_input_devices(
183
+ self, timeout: Optional[float] = 10
184
+ ) -> list[InputDevice]:
203
185
  """
204
186
  Retrieves the available input devices for recording.
205
187
 
206
188
  Args:
207
189
  timeout: The maximum amount of time (in seconds) to wait for a response.
190
+
208
191
  Returns:
209
192
  A list of available input devices.
193
+
210
194
  Raises:
211
195
  TimeoutError: If the request times out.
212
196
  """
213
- r = await self._invoke_method_async("get_input_devices", timeout=timeout)
197
+ r = await self._invoke_method("get_input_devices", timeout=timeout)
214
198
  return [
215
199
  InputDevice(id=device_id, label=label) for device_id, label in r.items()
216
200
  ]
217
201
 
218
- async def has_permission_async(self, timeout: Optional[float] = 10) -> bool:
202
+ async def has_permission(self, timeout: Optional[float] = 10) -> bool:
219
203
  """
220
204
  Checks if the app has permission to record audio.
221
205
 
222
206
  Args:
223
207
  timeout: The maximum amount of time (in seconds) to wait for a response.
208
+
224
209
  Returns:
225
210
  `True` if the app has permission, `False` otherwise.
211
+
226
212
  Raises:
227
213
  TimeoutError: If the request times out.
228
214
  """
229
- return await self._invoke_method_async("has_permission", timeout=timeout)
215
+ return await self._invoke_method("has_permission", timeout=timeout)
@@ -1,16 +1,19 @@
1
1
  from dataclasses import dataclass, field
2
2
  from enum import Enum
3
- from typing import List, Optional
3
+ from typing import TYPE_CHECKING, Optional
4
4
 
5
5
  import flet as ft
6
6
 
7
+ if TYPE_CHECKING:
8
+ from .audio_recorder import AudioRecorder # noqa
9
+
7
10
  __all__ = [
8
- "AudioRecorderState",
9
- "AudioEncoder",
10
- "AudioRecorderStateChangeEvent",
11
- "AudioRecorderConfiguration",
12
11
  "AndroidAudioSource",
13
12
  "AndroidRecorderConfiguration",
13
+ "AudioEncoder",
14
+ "AudioRecorderConfiguration",
15
+ "AudioRecorderState",
16
+ "AudioRecorderStateChangeEvent",
14
17
  "InputDevice",
15
18
  "IosAudioCategoryOption",
16
19
  "IosRecorderConfiguration",
@@ -31,7 +34,7 @@ class AudioRecorderState(Enum):
31
34
 
32
35
 
33
36
  @dataclass
34
- class AudioRecorderStateChangeEvent(ft.Event[ft.EventControlType]):
37
+ class AudioRecorderStateChangeEvent(ft.Event["AudioRecorder"]):
35
38
  state: AudioRecorderState
36
39
  """The new state of the audio recorder."""
37
40
 
@@ -43,42 +46,43 @@ class AudioEncoder(Enum):
43
46
 
44
47
  AACLC = "aacLc"
45
48
  """
46
- Advanced Audio Codec Low Complexity.
49
+ Advanced Audio Codec Low Complexity.
47
50
  A commonly used encoder for streaming and general audio recording.
48
51
  """
49
52
 
50
53
  AACELD = "aacEld"
51
54
  """
52
- Advanced Audio Codec Enhanced Low Delay.
55
+ Advanced Audio Codec Enhanced Low Delay.
53
56
  Suitable for low-latency applications like VoIP.
54
57
  """
55
58
 
56
59
  AACHE = "aacHe"
57
60
  """
58
- Advanced Audio Codec High Efficiency.
61
+ Advanced Audio Codec High Efficiency.
59
62
  Optimized for high-quality audio at lower bit rates.
60
63
  """
61
64
 
62
65
  AMRNB = "amrNb"
63
66
  """
64
- Adaptive Multi-Rate Narrow Band.
67
+ Adaptive Multi-Rate Narrow Band.
65
68
  Used for speech audio in mobile communication.
66
69
  """
67
70
 
68
71
  AMRWB = "amrWb"
69
72
  """
70
- Adaptive Multi-Rate Wide Band.
73
+ Adaptive Multi-Rate Wide Band.
71
74
  Used for higher-quality speech audio.
72
75
  """
73
76
 
74
77
  OPUS = "opus"
75
78
  """
76
- A codec designed for both speech and audio applications, known for its versatility.
79
+ A codec designed for both speech and audio applications,
80
+ known for its versatility.
77
81
  """
78
82
 
79
83
  FLAC = "flac"
80
84
  """
81
- Free Lossless Audio Codec.
85
+ Free Lossless Audio Codec.
82
86
  Provides high-quality lossless audio compression.
83
87
  """
84
88
 
@@ -113,7 +117,7 @@ class AndroidAudioSource(Enum):
113
117
 
114
118
  CAMCORDER = "camcorder"
115
119
  """
116
- Microphone audio source tuned for video recording,
120
+ Microphone audio source tuned for video recording,
117
121
  with the same orientation as the camera, if available.
118
122
  """
119
123
 
@@ -128,13 +132,13 @@ class AndroidAudioSource(Enum):
128
132
 
129
133
  UNPROCESSED = "unprocessed"
130
134
  """
131
- Microphone audio source tuned for unprocessed (raw) sound if available,
135
+ Microphone audio source tuned for unprocessed (raw) sound if available,
132
136
  behaves like `DEFAULT_SOURCE` otherwise.
133
137
  """
134
138
 
135
139
  VOICE_PERFORMANCE = "voicePerformance"
136
140
  """
137
- Source for capturing audio meant to be processed in real time
141
+ Source for capturing audio meant to be processed in real time
138
142
  and played back for live performance (e.g karaoke).
139
143
  """
140
144
 
@@ -146,15 +150,15 @@ class AndroidRecorderConfiguration:
146
150
  use_legacy: bool = False
147
151
  """
148
152
  Whether to use the Android MediaRecorder.
149
-
150
- While advanced recorder (the default) unlocks additionnal features,
153
+
154
+ While advanced recorder (the default) unlocks additionnal features,
151
155
  the legacy recorder is stability oriented.
152
156
  """
153
157
 
154
158
  mute_audio: bool = False
155
159
  """
156
160
  Whether to mute all audio streams like alarms, music, ring, etc.
157
-
161
+
158
162
  This is useful when you want to record audio without any background noise.
159
163
  The streams are restored to their previous state after recording is stopped
160
164
  and will stay at current state on pause/resume.
@@ -168,11 +172,14 @@ class AndroidRecorderConfiguration:
168
172
  audio_source: AndroidAudioSource = AndroidAudioSource.DEFAULT_SOURCE
169
173
  """
170
174
  Defines the audio source.
171
-
172
- An audio source defines both a default physical source of audio signal, and a recording configuration.
175
+
176
+ An audio source defines both a default physical source of audio signal,
177
+ and a recording configuration.
173
178
  Some effects are available or not depending on this source.
174
-
175
- Most of the time, you should use `AndroidAudioSource.DEFAULT_SOURCE` or `AndroidAudioSource.MIC`.
179
+
180
+ Most of the time, you should use
181
+ [`AndroidAudioSource.DEFAULT_SOURCE`][(p).] or
182
+ [`AndroidAudioSource.MIC`][(p).].
176
183
  """
177
184
 
178
185
 
@@ -185,7 +192,7 @@ class IosAudioCategoryOption(Enum):
185
192
 
186
193
  MIX_WITH_OTHERS = "mixWithOthers"
187
194
  """
188
- Whether audio from this session mixes with audio
195
+ Whether audio from this session mixes with audio
189
196
  from active sessions in other audio apps.
190
197
  """
191
198
 
@@ -207,30 +214,33 @@ class IosAudioCategoryOption(Enum):
207
214
  INTERRUPT_SPOKEN_AUDIO_AND_MIX_WITH_OTHERS = "interruptSpokenAudioAndMixWithOthers"
208
215
  """
209
216
  Pause spoken audio content from other sessions when your app plays its audio.
210
-
217
+
211
218
  Available from iOS 9.0.
212
219
  """
213
220
 
214
221
  ALLOW_BLUETOOTH_A2DP = "allowBluetoothA2DP"
215
222
  """
216
- Stream audio from this session to Bluetooth devices
223
+ Stream audio from this session to Bluetooth devices
217
224
  that support the Advanced Audio Distribution Profile (A2DP).
218
-
219
- Available from iOS 10.0.
225
+
226
+ Note:
227
+ Available from iOS 10.0.
220
228
  """
221
229
 
222
230
  ALLOW_AIRPLAY = "allowAirPlay"
223
231
  """
224
232
  Stream audio from this session to AirPlay devices.
225
-
226
- Available from iOS 10.0.
233
+
234
+ Note:
235
+ Available from iOS 10.0.
227
236
  """
228
237
 
229
238
  OVERRIDE_MUTED_MICROPHONE_INTERRUPTION = "overrideMutedMicrophoneInterruption"
230
239
  """
231
240
  System interrupts the audio session when it mutes the built-in microphone.
232
-
233
- Available from iOS 14.5.
241
+
242
+ Note:
243
+ Available from iOS 14.5.
234
244
  """
235
245
 
236
246
 
@@ -238,7 +248,7 @@ class IosAudioCategoryOption(Enum):
238
248
  class IosRecorderConfiguration:
239
249
  """iOS specific configuration for recording."""
240
250
 
241
- options: List[IosAudioCategoryOption] = field(
251
+ options: list[IosAudioCategoryOption] = field(
242
252
  default_factory=lambda: [
243
253
  IosAudioCategoryOption.DEFAULT_TO_SPEAKER,
244
254
  IosAudioCategoryOption.ALLOW_BLUETOOTH,
@@ -252,8 +262,9 @@ class IosRecorderConfiguration:
252
262
  manage_audio_session: bool = True
253
263
  """
254
264
  Whether to manage the shared AVAudioSession.
255
-
256
- Set this to `false` if another plugin is already managing the AVAudioSession.
265
+
266
+ Set this to `False` if another plugin is
267
+ already managing the AVAudioSession.
257
268
  """
258
269
 
259
270
 
@@ -279,21 +290,22 @@ class AudioRecorderConfiguration:
279
290
 
280
291
  suppress_noise: bool = False
281
292
  """
282
- The recorder will try to negates the input noise (if available on the device).
283
-
293
+ The recorder will try to negate the input
294
+ noise (if available on the device).
295
+
284
296
  Recording volume may be lowered by using this.
285
297
  """
286
298
 
287
299
  cancel_echo: bool = False
288
300
  """
289
301
  The recorder will try to reduce echo (if available on the device).
290
-
302
+
291
303
  Recording volume may be lowered by using this.
292
304
  """
293
305
 
294
306
  auto_gain: bool = False
295
307
  """
296
- The recorder will try to auto adjust recording volume in a
308
+ The recorder will try to auto adjust recording volume in a
297
309
  limited range (if available on the device).
298
310
 
299
311
  Recording volume may be lowered by using this.
@@ -301,8 +313,12 @@ class AudioRecorderConfiguration:
301
313
 
302
314
  channels: int = 2
303
315
  """
304
- The numbers of channels for the recording: `1` = mono, `2` = stereo
305
- Most platforms only accept 2 at most.
316
+ The numbers of channels for the recording.
317
+
318
+ - `1` for mono
319
+ - `2` for stereo
320
+
321
+ Most platforms only accept at most 2 channels.
306
322
  """
307
323
 
308
324
  sample_rate: int = 44100
@@ -317,7 +333,8 @@ class AudioRecorderConfiguration:
317
333
 
318
334
  device: Optional[InputDevice] = None
319
335
  """
320
- The device to be used for recording.
336
+ The device to be used for recording.
337
+
321
338
  If `None`, default device will be selected.
322
339
  """
323
340
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-audio-recorder
3
- Version: 0.2.0.dev55
3
+ Version: 0.2.0.dev69
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
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ✅ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-audio-recorder` package and add it to your project dependencies:
47
49
 
@@ -64,6 +66,6 @@ To install the `flet-audio-recorder` package and add it to your project dependen
64
66
  > [!NOTE]
65
67
  > On Linux, encoding is provided by [fmedia](https://stsaz.github.io/fmedia/) which must be installed separately.
66
68
 
67
- ## Examples
69
+ ### Examples
68
70
 
69
- For examples, see [this](./examples)
71
+ For examples, see [these](./examples).
@@ -13,10 +13,10 @@ packages:
13
13
  dependency: transitive
14
14
  description:
15
15
  name: async
16
- sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
16
+ sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
17
17
  url: "https://pub.dev"
18
18
  source: hosted
19
- version: "2.12.0"
19
+ version: "2.13.0"
20
20
  boolean_selector:
21
21
  dependency: transitive
22
22
  description:
@@ -65,6 +65,14 @@ packages:
65
65
  url: "https://pub.dev"
66
66
  source: hosted
67
67
  version: "3.0.6"
68
+ dbus:
69
+ dependency: transitive
70
+ description:
71
+ name: dbus
72
+ sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
73
+ url: "https://pub.dev"
74
+ source: hosted
75
+ version: "0.7.11"
68
76
  device_info_plus:
69
77
  dependency: transitive
70
78
  description:
@@ -93,10 +101,10 @@ packages:
93
101
  dependency: transitive
94
102
  description:
95
103
  name: fake_async
96
- sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
104
+ sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
97
105
  url: "https://pub.dev"
98
106
  source: hosted
99
- version: "1.3.2"
107
+ version: "1.3.3"
100
108
  ffi:
101
109
  dependency: transitive
102
110
  description:
@@ -117,10 +125,10 @@ packages:
117
125
  dependency: transitive
118
126
  description:
119
127
  name: file_picker
120
- sha256: ef9908739bdd9c476353d6adff72e88fd00c625f5b959ae23f7567bd5137db0a
128
+ sha256: ef7d2a085c1b1d69d17b6842d0734aad90156de08df6bd3c12496d0bd6ddf8e2
121
129
  url: "https://pub.dev"
122
130
  source: hosted
123
- version: "10.2.0"
131
+ version: "10.3.1"
124
132
  fixnum:
125
133
  dependency: transitive
126
134
  description:
@@ -134,7 +142,7 @@ packages:
134
142
  description:
135
143
  path: "packages/flet"
136
144
  ref: main
137
- resolved-ref: b996d06ff462b88f5b31d6cceafac34ea6f57968
145
+ resolved-ref: "4ea9558543657d31dba3b11d6017beed2e16d447"
138
146
  url: "https://github.com/flet-dev/flet.git"
139
147
  source: git
140
148
  version: "0.70.0"
@@ -155,10 +163,10 @@ packages:
155
163
  dependency: "direct dev"
156
164
  description:
157
165
  name: flutter_lints
158
- sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
166
+ sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
159
167
  url: "https://pub.dev"
160
168
  source: hosted
161
- version: "2.0.3"
169
+ version: "3.0.2"
162
170
  flutter_localizations:
163
171
  dependency: transitive
164
172
  description: flutter
@@ -176,10 +184,10 @@ packages:
176
184
  dependency: transitive
177
185
  description:
178
186
  name: flutter_plugin_android_lifecycle
179
- sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e
187
+ sha256: "6382ce712ff69b0f719640ce957559dde459e55ecd433c767e06d139ddf16cab"
180
188
  url: "https://pub.dev"
181
189
  source: hosted
182
- version: "2.0.28"
190
+ version: "2.0.29"
183
191
  flutter_svg:
184
192
  dependency: transitive
185
193
  description:
@@ -226,10 +234,10 @@ packages:
226
234
  dependency: transitive
227
235
  description:
228
236
  name: intl
229
- sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
237
+ sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
230
238
  url: "https://pub.dev"
231
239
  source: hosted
232
- version: "0.19.0"
240
+ version: "0.20.2"
233
241
  json_annotation:
234
242
  dependency: transitive
235
243
  description:
@@ -242,10 +250,10 @@ packages:
242
250
  dependency: transitive
243
251
  description:
244
252
  name: leak_tracker
245
- sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
253
+ sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
246
254
  url: "https://pub.dev"
247
255
  source: hosted
248
- version: "10.0.8"
256
+ version: "10.0.9"
249
257
  leak_tracker_flutter_testing:
250
258
  dependency: transitive
251
259
  description:
@@ -266,10 +274,10 @@ packages:
266
274
  dependency: transitive
267
275
  description:
268
276
  name: lints
269
- sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
277
+ sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
270
278
  url: "https://pub.dev"
271
279
  source: hosted
272
- version: "2.1.1"
280
+ version: "3.0.0"
273
281
  logging:
274
282
  dependency: transitive
275
283
  description:
@@ -362,10 +370,10 @@ packages:
362
370
  dependency: transitive
363
371
  description:
364
372
  name: path_provider_foundation
365
- sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
373
+ sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
366
374
  url: "https://pub.dev"
367
375
  source: hosted
368
- version: "2.4.1"
376
+ version: "2.4.2"
369
377
  path_provider_linux:
370
378
  dependency: transitive
371
379
  description:
@@ -434,50 +442,50 @@ packages:
434
442
  dependency: transitive
435
443
  description:
436
444
  name: record_android
437
- sha256: "97d7122455f30de89a01c6c244c839085be6b12abca251fc0e78f67fed73628b"
445
+ sha256: "8b170e33d9866f9b51e01a767d7e1ecb97b9ecd629950bd87a47c79359ec57f8"
438
446
  url: "https://pub.dev"
439
447
  source: hosted
440
- version: "1.3.3"
448
+ version: "1.4.0"
441
449
  record_ios:
442
450
  dependency: transitive
443
451
  description:
444
452
  name: record_ios
445
- sha256: "73706ebbece6150654c9d6f57897cf9b622c581148304132ba85dba15df0fdfb"
453
+ sha256: ad97d0a75933c44bcf5aff648e86e32fc05eb61f8fbef190f14968c8eaf86692
446
454
  url: "https://pub.dev"
447
455
  source: hosted
448
- version: "1.0.0"
456
+ version: "1.1.0"
449
457
  record_linux:
450
458
  dependency: transitive
451
459
  description:
452
460
  name: record_linux
453
- sha256: "0626678a092c75ce6af1e32fe7fd1dea709b92d308bc8e3b6d6348e2430beb95"
461
+ sha256: "785e8e8d6db109aa606d0669d95aaae416458aaa39782bb0abe0bee74eee17d7"
454
462
  url: "https://pub.dev"
455
463
  source: hosted
456
- version: "1.1.1"
464
+ version: "1.2.0"
457
465
  record_macos:
458
466
  dependency: transitive
459
467
  description:
460
468
  name: record_macos
461
- sha256: "02240833fde16c33fcf2c589f3e08d4394b704761b4a3bb609d872ff3043fbbd"
469
+ sha256: f1399bca76a1634da109e5b0cba764ed8332a2b4da49c704c66d2c553405ed81
462
470
  url: "https://pub.dev"
463
471
  source: hosted
464
- version: "1.0.0"
472
+ version: "1.1.0"
465
473
  record_platform_interface:
466
474
  dependency: transitive
467
475
  description:
468
476
  name: record_platform_interface
469
- sha256: c1ad38f51e4af88a085b3e792a22c685cb3e7c23fc37aa7ce44c4cf18f25fe89
477
+ sha256: b0065fdf1ec28f5a634d676724d388a77e43ce7646fb049949f58c69f3fcb4ed
470
478
  url: "https://pub.dev"
471
479
  source: hosted
472
- version: "1.3.0"
480
+ version: "1.4.0"
473
481
  record_web:
474
482
  dependency: transitive
475
483
  description:
476
484
  name: record_web
477
- sha256: a12856d0b3dd03d336b4b10d7520a8b3e21649a06a8f95815318feaa8f07adbb
485
+ sha256: "4f0adf20c9ccafcc02d71111fd91fba1ca7b17a7453902593e5a9b25b74a5c56"
478
486
  url: "https://pub.dev"
479
487
  source: hosted
480
- version: "1.1.9"
488
+ version: "1.2.0"
481
489
  record_windows:
482
490
  dependency: transitive
483
491
  description:
@@ -526,14 +534,22 @@ packages:
526
534
  url: "https://pub.dev"
527
535
  source: hosted
528
536
  version: "0.2.0"
537
+ screenshot:
538
+ dependency: transitive
539
+ description:
540
+ name: screenshot
541
+ sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b"
542
+ url: "https://pub.dev"
543
+ source: hosted
544
+ version: "3.0.0"
529
545
  sensors_plus:
530
546
  dependency: transitive
531
547
  description:
532
548
  name: sensors_plus
533
- sha256: "905282c917c6bb731c242f928665c2ea15445aa491249dea9d98d7c79dc8fd39"
549
+ sha256: "89e2bfc3d883743539ce5774a2b93df61effde40ff958ecad78cd66b1a8b8d52"
534
550
  url: "https://pub.dev"
535
551
  source: hosted
536
- version: "6.1.1"
552
+ version: "6.1.2"
537
553
  sensors_plus_platform_interface:
538
554
  dependency: transitive
539
555
  description:
@@ -554,10 +570,10 @@ packages:
554
570
  dependency: transitive
555
571
  description:
556
572
  name: shared_preferences_android
557
- sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac"
573
+ sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e"
558
574
  url: "https://pub.dev"
559
575
  source: hosted
560
- version: "2.4.10"
576
+ version: "2.4.11"
561
577
  shared_preferences_foundation:
562
578
  dependency: transitive
563
579
  description:
@@ -679,18 +695,18 @@ packages:
679
695
  dependency: transitive
680
696
  description:
681
697
  name: url_launcher_android
682
- sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79"
698
+ sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656"
683
699
  url: "https://pub.dev"
684
700
  source: hosted
685
- version: "6.3.16"
701
+ version: "6.3.17"
686
702
  url_launcher_ios:
687
703
  dependency: transitive
688
704
  description:
689
705
  name: url_launcher_ios
690
- sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
706
+ sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7
691
707
  url: "https://pub.dev"
692
708
  source: hosted
693
- version: "6.3.3"
709
+ version: "6.3.4"
694
710
  url_launcher_linux:
695
711
  dependency: transitive
696
712
  description:
@@ -703,10 +719,10 @@ packages:
703
719
  dependency: transitive
704
720
  description:
705
721
  name: url_launcher_macos
706
- sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
722
+ sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f
707
723
  url: "https://pub.dev"
708
724
  source: hosted
709
- version: "3.2.2"
725
+ version: "3.2.3"
710
726
  url_launcher_platform_interface:
711
727
  dependency: transitive
712
728
  description:
@@ -759,10 +775,10 @@ packages:
759
775
  dependency: transitive
760
776
  description:
761
777
  name: vector_graphics_compiler
762
- sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331"
778
+ sha256: ca81fdfaf62a5ab45d7296614aea108d2c7d0efca8393e96174bf4d51e6725b0
763
779
  url: "https://pub.dev"
764
780
  source: hosted
765
- version: "1.1.17"
781
+ version: "1.1.18"
766
782
  vector_math:
767
783
  dependency: transitive
768
784
  description:
@@ -775,10 +791,10 @@ packages:
775
791
  dependency: transitive
776
792
  description:
777
793
  name: vm_service
778
- sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
794
+ sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
779
795
  url: "https://pub.dev"
780
796
  source: hosted
781
- version: "14.3.1"
797
+ version: "15.0.0"
782
798
  web:
783
799
  dependency: transitive
784
800
  description:
@@ -807,10 +823,10 @@ packages:
807
823
  dependency: transitive
808
824
  description:
809
825
  name: win32
810
- sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba"
826
+ sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
811
827
  url: "https://pub.dev"
812
828
  source: hosted
813
- version: "5.13.0"
829
+ version: "5.14.0"
814
830
  win32_registry:
815
831
  dependency: transitive
816
832
  description:
@@ -823,10 +839,10 @@ packages:
823
839
  dependency: transitive
824
840
  description:
825
841
  name: window_manager
826
- sha256: "51d50168ab267d344b975b15390426b1243600d436770d3f13de67e55b05ec16"
842
+ sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd"
827
843
  url: "https://pub.dev"
828
844
  source: hosted
829
- version: "0.5.0"
845
+ version: "0.5.1"
830
846
  window_to_front:
831
847
  dependency: transitive
832
848
  description:
@@ -852,5 +868,5 @@ packages:
852
868
  source: hosted
853
869
  version: "6.5.0"
854
870
  sdks:
855
- dart: ">=3.7.0 <4.0.0"
871
+ dart: ">=3.8.0 <4.0.0"
856
872
  flutter: ">=3.29.0"
@@ -20,4 +20,4 @@ dependencies:
20
20
  dev_dependencies:
21
21
  flutter_test:
22
22
  sdk: flutter
23
- flutter_lints: ^2.0.0
23
+ flutter_lints: ^3.0.0