You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform errors may occur when recording is interupted. You must decide what happens if such an error occurs.
59
83
The [onError] callback must be of type `void Function(Object error)`
60
84
or `void Function(Object error, StackTrace)`.
61
85
62
-
````dart
86
+
```dart
63
87
void onError(Object error) {
64
88
print(error.toString());
65
89
_isRecording = false;
66
90
}
67
-
````
91
+
```
68
92
69
93
### Stop listening
94
+
70
95
To stop listening, the `.cancel()` method is called on the subscription object.
96
+
71
97
```dart
72
98
void stopRecorder() async {
73
99
try {
@@ -83,17 +109,21 @@ void stopRecorder() async {
83
109
}
84
110
}
85
111
```
112
+
86
113
## Technical documentation
87
114
88
115
### Sample rate
89
-
The sample rate for both native implementations is 44,100.
116
+
117
+
The sample rate for both native implementations are 44,100.
90
118
91
119
### Microphone data
120
+
92
121
The native implementations record PCM data using the microphone of the device, and uses an audio buffer array to store the incoming data. When the buffer is filled, the contents are emitted to the Flutter side. The incoming floating point values are between -1 and 1 which is the PCM values divided by the max amplitude value which is 2^15.
93
122
94
123
### Conversion to Decibel
95
124
96
125
Computing the decibel of a PCM value is done as follows:
0 commit comments