@react-native-ohos/react-native-audio-recorder-player 3.6.11 → 3.6.12

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 (36) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +21 -21
  3. package/README.OpenSource +10 -10
  4. package/README.md +899 -14
  5. package/harmony/audio_recorder_player/BuildProfile.ets +17 -0
  6. package/harmony/audio_recorder_player/LICENSE +21 -21
  7. package/harmony/audio_recorder_player/ResourceTable.txt +1 -1
  8. package/harmony/audio_recorder_player/build-profile.json5 +28 -28
  9. package/harmony/audio_recorder_player/index.ets +27 -26
  10. package/harmony/audio_recorder_player/oh-package-lock.json5 +29 -0
  11. package/harmony/audio_recorder_player/oh-package.json5 +20 -20
  12. package/harmony/audio_recorder_player/src/main/cpp/CMakeLists.txt +7 -7
  13. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerPackage.h +52 -52
  14. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.cpp +92 -92
  15. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.h +37 -37
  16. package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerPackage.ets +48 -48
  17. package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerTurboModule.ts +316 -310
  18. package/harmony/audio_recorder_player/src/main/ets/audioPlayer/AudioPlayer.ts +419 -414
  19. package/harmony/audio_recorder_player/src/main/ets/audioPlayer/types.ts +43 -43
  20. package/harmony/audio_recorder_player/src/main/ets/index.d.ts +209 -209
  21. package/harmony/audio_recorder_player/src/main/ets/recorder/Recorder.ts +305 -299
  22. package/harmony/audio_recorder_player/src/main/ets/recorder/types.ts +61 -61
  23. package/harmony/audio_recorder_player/src/main/ets/utils/DateTimeUtils.ts +88 -88
  24. package/harmony/audio_recorder_player/src/main/ets/utils/Logger.ts +45 -45
  25. package/harmony/audio_recorder_player/src/main/ets/utils/SaveAudioAsset.ts +101 -105
  26. package/harmony/audio_recorder_player/src/main/module.json5 +9 -9
  27. package/harmony/audio_recorder_player/src/main/resources/base/element/string.json +8 -8
  28. package/harmony/audio_recorder_player/src/main/resources/base/media/ic_public_error.svg +9 -9
  29. package/harmony/audio_recorder_player/src/main/resources/en_US/element/string.json +8 -8
  30. package/harmony/audio_recorder_player/src/main/resources/zh_CN/element/string.json +8 -8
  31. package/harmony/audio_recorder_player/ts.ets +26 -26
  32. package/harmony/audio_recorder_player.har +0 -0
  33. package/index.d.ts +227 -227
  34. package/index.ts +530 -525
  35. package/package.json +77 -68
  36. package/src/NativeAudioRecorderPlayerModule.ts +41 -41
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from npm package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from npm package"
6
+ }
7
+ ]
8
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from npm package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from npm package"
6
+ }
7
+ ]
8
+ }
@@ -1,27 +1,27 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2023 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- export * from './src/main/ets/RNAudioRecorderPlayerPackage';
26
-
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ export * from './src/main/ets/RNAudioRecorderPlayerPackage';
26
+
27
27
  export * from './src/main/ets/RNAudioRecorderPlayerTurboModule';
Binary file
package/index.d.ts CHANGED
@@ -1,227 +1,227 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (C) 2023 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- export enum AudioSourceHarmonyType {
26
- DEFAULT = 0,
27
- MIC,
28
- VOICE_RECOGNITION,
29
- VOICE_COMMUNICATION = 7,
30
- VOICE_MESSAGE = 10,
31
- CAMCORDER = 12,
32
- }
33
-
34
- export enum AudioFormatHarmonyType {
35
- MPEG_4 = 'mp4',
36
- MPEG_4A = 'm4a',
37
- MP3 = 'mp3',
38
- WAV = 'wav',
39
- AAC = 'aac',
40
- }
41
-
42
- export enum AudioMimeHarmonyType {
43
- AUDIO_AAC = 'audio/mp4a-latm', // 表示音频/mp4a-latm类型。
44
-
45
- AUDIO_VORBIS = 'audio/vorbis', // 表示音频/vorbis类型。
46
- AUDIO_FLAC = 'audio/flac', // 表示音频/flac类型。
47
- AUDIO_MP3 = 'audio/mpeg', // 表示音频/mpeg类型。
48
- AUDIO_G711MU = 'audio/g711mu', // 表示音频/G711-mulaw类型。
49
- }
50
-
51
- export enum AudioSourceAndroidType {
52
- DEFAULT = 0,
53
- MIC,
54
- }
55
-
56
- export enum OutputFormatAndroidType {
57
- DEFAULT = 0,
58
- THREE_GPP,
59
- MPEG_4,
60
- AMR_NB,
61
- AMR_WB,
62
- AAC_ADIF,
63
- AAC_ADTS,
64
- OUTPUT_FORMAT_RTP_AVP,
65
- MPEG_2_TS,
66
- WEBM,
67
- UNUSED,
68
- OGG,
69
- }
70
-
71
- export enum AudioEncoderAndroidType {
72
- DEFAULT = 0,
73
- AMR_NB,
74
- AMR_WB,
75
- AAC,
76
- HE_AAC,
77
- AAC_ELD,
78
- VORBIS,
79
- OPUS,
80
- }
81
-
82
- export enum AVEncodingOption {
83
- lpcm = 'lpcm',
84
- ima4 = 'ima4',
85
- aac = 'aac',
86
- MAC3 = 'MAC3',
87
- MAC6 = 'MAC6',
88
- ulaw = 'ulaw',
89
- alaw = 'alaw',
90
- mp1 = 'mp1',
91
- mp2 = 'mp2',
92
- mp4 = 'mp4',
93
- alac = 'alac',
94
- amr = 'amr',
95
- flac = 'flac',
96
- opus = 'opus',
97
- wav = 'wav',
98
- }
99
-
100
- export type AVEncodingType =
101
- | AVEncodingOption.lpcm
102
- | AVEncodingOption.ima4
103
- | AVEncodingOption.aac
104
- | AVEncodingOption.MAC3
105
- | AVEncodingOption.MAC6
106
- | AVEncodingOption.ulaw
107
- | AVEncodingOption.alaw
108
- | AVEncodingOption.mp1
109
- | AVEncodingOption.mp2
110
- | AVEncodingOption.mp4
111
- | AVEncodingOption.alac
112
- | AVEncodingOption.amr
113
- | AVEncodingOption.flac
114
- | AVEncodingOption.opus
115
- | AVEncodingOption.wav;
116
-
117
- export enum AVModeIOSOption {
118
- gamechat = 'gamechat',
119
- measurement = 'measurement',
120
- movieplayback = 'movieplayback',
121
- spokenaudio = 'spokenaudio',
122
- videochat = 'videochat',
123
- videorecording = 'videorecording',
124
- voicechat = 'voicechat',
125
- voiceprompt = 'voiceprompt',
126
- }
127
-
128
- export type AVModeIOSType =
129
- | AVModeIOSOption.gamechat
130
- | AVModeIOSOption.measurement
131
- | AVModeIOSOption.movieplayback
132
- | AVModeIOSOption.spokenaudio
133
- | AVModeIOSOption.videochat
134
- | AVModeIOSOption.videorecording
135
- | AVModeIOSOption.voicechat
136
- | AVModeIOSOption.voiceprompt;
137
-
138
- export enum AVEncoderAudioQualityIOSType {
139
- min = 0,
140
- low = 32,
141
- medium = 64,
142
- high = 96,
143
- max = 127,
144
- }
145
-
146
- export enum AVLinearPCMBitDepthKeyIOSType {
147
- 'bit8' = 8,
148
- 'bit16' = 16,
149
- 'bit24' = 24,
150
- 'bit32' = 32,
151
- }
152
-
153
- export interface AudioSet {
154
- AVSampleRateKeyIOS?: number;
155
- AVFormatIDKeyIOS?: AVEncodingType;
156
- AVModeIOS?: AVModeIOSType;
157
- AVNumberOfChannelsKeyIOS?: number;
158
- AVEncoderAudioQualityKeyIOS?: AVEncoderAudioQualityIOSType;
159
- AVLinearPCMBitDepthKeyIOS?: AVLinearPCMBitDepthKeyIOSType;
160
- AVLinearPCMIsBigEndianKeyIOS?: boolean;
161
- AVLinearPCMIsFloatKeyIOS?: boolean;
162
- AVLinearPCMIsNonInterleavedIOS?: boolean;
163
- AVEncoderBitRateKeyIOS?: number;
164
- OutputFormatAndroid?: OutputFormatAndroidType;
165
- AudioEncoderAndroid?: AudioEncoderAndroidType;
166
- AudioEncodingBitRateAndroid?: number;
167
- AudioSamplingRateAndroid?: number;
168
- AudioChannelsAndroid?: number;
169
- AudioSourceAndroid?: AudioSourceAndroidType;
170
- AudioSourceHarmony?: AudioSourceHarmonyType;
171
- AudioMimeHarmony?: AudioMimeHarmonyType;
172
- AudioFileFormatHarmony?: AudioFormatHarmonyType;
173
- /**
174
- * 音频编码比特率,选择音频录制时必填。
175
-
176
- 支持范围:
177
-
178
- - AAC编码格式支持比特率范围[32000 - 500000]。
179
-
180
- - G711-mulaw编码格式支持比特率范围[64000 - 64000]。
181
-
182
- - MP3编码格式支持范围[8000, 16000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000]。
183
-
184
- 当使用MP3编码格式时,采样率和比特率的映射关系:
185
-
186
- - 采样率使用16K以下时,对应比特率范围为[8kbps - 64kbps]。
187
-
188
- - 采样率使用16K~32K时对应的比特率范围为[8kbps - 160kbps]。
189
-
190
- - 采样率使用32K以上时对应的比特率范围为[32kbps - 320kbps]。
191
- */
192
- AudioEncodingBitRateHarmony?: number;
193
- /**
194
- * 支持范围:
195
-
196
- - AAC编码支持采样率范围[8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000]。
197
-
198
- - G711-mulaw编码支持采样率范围[8000 - 8000]。
199
-
200
- - MP3编码支持采样率范围[8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000]。
201
- */
202
- AudioSamplingRateHarmony?: number;
203
- /**
204
- * 音频采集声道数
205
-
206
- - AAC编码格式支持范围[1 - 8]。
207
-
208
- - G711-mulaw编码格式支持范围[1 - 1]。
209
-
210
- - MP3编码格式支持范围[1 - 2]
211
- */
212
- AudioChannelsHarmony?: number;
213
- }
214
-
215
- export type RecordBackType = {
216
- isRecording?: boolean;
217
- currentPosition: number;
218
- currentMetering?: number;
219
- };
220
-
221
- export type PlayBackType = {
222
- isMuted?: boolean;
223
- currentPosition: number;
224
- duration: number;
225
- isFinished: boolean;
226
- };
227
-
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ export enum AudioSourceHarmonyType {
26
+ DEFAULT = 0,
27
+ MIC,
28
+ VOICE_RECOGNITION,
29
+ VOICE_COMMUNICATION = 7,
30
+ VOICE_MESSAGE = 10,
31
+ CAMCORDER = 12,
32
+ }
33
+
34
+ export enum AudioFormatHarmonyType {
35
+ MPEG_4 = 'mp4',
36
+ MPEG_4A = 'm4a',
37
+ MP3 = 'mp3',
38
+ WAV = 'wav',
39
+ AAC = 'aac',
40
+ }
41
+
42
+ export enum AudioMimeHarmonyType {
43
+ AUDIO_AAC = 'audio/mp4a-latm', // 表示音频/mp4a-latm类型。
44
+
45
+ AUDIO_VORBIS = 'audio/vorbis', // 表示音频/vorbis类型。
46
+ AUDIO_FLAC = 'audio/flac', // 表示音频/flac类型。
47
+ AUDIO_MP3 = 'audio/mpeg', // 表示音频/mpeg类型。
48
+ AUDIO_G711MU = 'audio/g711mu', // 表示音频/G711-mulaw类型。
49
+ }
50
+
51
+ export enum AudioSourceAndroidType {
52
+ DEFAULT = 0,
53
+ MIC,
54
+ }
55
+
56
+ export enum OutputFormatAndroidType {
57
+ DEFAULT = 0,
58
+ THREE_GPP,
59
+ MPEG_4,
60
+ AMR_NB,
61
+ AMR_WB,
62
+ AAC_ADIF,
63
+ AAC_ADTS,
64
+ OUTPUT_FORMAT_RTP_AVP,
65
+ MPEG_2_TS,
66
+ WEBM,
67
+ UNUSED,
68
+ OGG,
69
+ }
70
+
71
+ export enum AudioEncoderAndroidType {
72
+ DEFAULT = 0,
73
+ AMR_NB,
74
+ AMR_WB,
75
+ AAC,
76
+ HE_AAC,
77
+ AAC_ELD,
78
+ VORBIS,
79
+ OPUS,
80
+ }
81
+
82
+ export enum AVEncodingOption {
83
+ lpcm = 'lpcm',
84
+ ima4 = 'ima4',
85
+ aac = 'aac',
86
+ MAC3 = 'MAC3',
87
+ MAC6 = 'MAC6',
88
+ ulaw = 'ulaw',
89
+ alaw = 'alaw',
90
+ mp1 = 'mp1',
91
+ mp2 = 'mp2',
92
+ mp4 = 'mp4',
93
+ alac = 'alac',
94
+ amr = 'amr',
95
+ flac = 'flac',
96
+ opus = 'opus',
97
+ wav = 'wav',
98
+ }
99
+
100
+ export type AVEncodingType =
101
+ | AVEncodingOption.lpcm
102
+ | AVEncodingOption.ima4
103
+ | AVEncodingOption.aac
104
+ | AVEncodingOption.MAC3
105
+ | AVEncodingOption.MAC6
106
+ | AVEncodingOption.ulaw
107
+ | AVEncodingOption.alaw
108
+ | AVEncodingOption.mp1
109
+ | AVEncodingOption.mp2
110
+ | AVEncodingOption.mp4
111
+ | AVEncodingOption.alac
112
+ | AVEncodingOption.amr
113
+ | AVEncodingOption.flac
114
+ | AVEncodingOption.opus
115
+ | AVEncodingOption.wav;
116
+
117
+ export enum AVModeIOSOption {
118
+ gamechat = 'gamechat',
119
+ measurement = 'measurement',
120
+ movieplayback = 'movieplayback',
121
+ spokenaudio = 'spokenaudio',
122
+ videochat = 'videochat',
123
+ videorecording = 'videorecording',
124
+ voicechat = 'voicechat',
125
+ voiceprompt = 'voiceprompt',
126
+ }
127
+
128
+ export type AVModeIOSType =
129
+ | AVModeIOSOption.gamechat
130
+ | AVModeIOSOption.measurement
131
+ | AVModeIOSOption.movieplayback
132
+ | AVModeIOSOption.spokenaudio
133
+ | AVModeIOSOption.videochat
134
+ | AVModeIOSOption.videorecording
135
+ | AVModeIOSOption.voicechat
136
+ | AVModeIOSOption.voiceprompt;
137
+
138
+ export enum AVEncoderAudioQualityIOSType {
139
+ min = 0,
140
+ low = 32,
141
+ medium = 64,
142
+ high = 96,
143
+ max = 127,
144
+ }
145
+
146
+ export enum AVLinearPCMBitDepthKeyIOSType {
147
+ 'bit8' = 8,
148
+ 'bit16' = 16,
149
+ 'bit24' = 24,
150
+ 'bit32' = 32,
151
+ }
152
+
153
+ export interface AudioSet {
154
+ AVSampleRateKeyIOS?: number;
155
+ AVFormatIDKeyIOS?: AVEncodingType;
156
+ AVModeIOS?: AVModeIOSType;
157
+ AVNumberOfChannelsKeyIOS?: number;
158
+ AVEncoderAudioQualityKeyIOS?: AVEncoderAudioQualityIOSType;
159
+ AVLinearPCMBitDepthKeyIOS?: AVLinearPCMBitDepthKeyIOSType;
160
+ AVLinearPCMIsBigEndianKeyIOS?: boolean;
161
+ AVLinearPCMIsFloatKeyIOS?: boolean;
162
+ AVLinearPCMIsNonInterleavedIOS?: boolean;
163
+ AVEncoderBitRateKeyIOS?: number;
164
+ OutputFormatAndroid?: OutputFormatAndroidType;
165
+ AudioEncoderAndroid?: AudioEncoderAndroidType;
166
+ AudioEncodingBitRateAndroid?: number;
167
+ AudioSamplingRateAndroid?: number;
168
+ AudioChannelsAndroid?: number;
169
+ AudioSourceAndroid?: AudioSourceAndroidType;
170
+ AudioSourceHarmony?: AudioSourceHarmonyType;
171
+ AudioMimeHarmony?: AudioMimeHarmonyType;
172
+ AudioFileFormatHarmony?: AudioFormatHarmonyType;
173
+ /**
174
+ * 音频编码比特率,选择音频录制时必填。
175
+
176
+ 支持范围:
177
+
178
+ - AAC编码格式支持比特率范围[32000 - 500000]。
179
+
180
+ - G711-mulaw编码格式支持比特率范围[64000 - 64000]。
181
+
182
+ - MP3编码格式支持范围[8000, 16000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000]。
183
+
184
+ 当使用MP3编码格式时,采样率和比特率的映射关系:
185
+
186
+ - 采样率使用16K以下时,对应比特率范围为[8kbps - 64kbps]。
187
+
188
+ - 采样率使用16K~32K时对应的比特率范围为[8kbps - 160kbps]。
189
+
190
+ - 采样率使用32K以上时对应的比特率范围为[32kbps - 320kbps]。
191
+ */
192
+ AudioEncodingBitRateHarmony?: number;
193
+ /**
194
+ * 支持范围:
195
+
196
+ - AAC编码支持采样率范围[8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000]。
197
+
198
+ - G711-mulaw编码支持采样率范围[8000 - 8000]。
199
+
200
+ - MP3编码支持采样率范围[8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000]。
201
+ */
202
+ AudioSamplingRateHarmony?: number;
203
+ /**
204
+ * 音频采集声道数
205
+
206
+ - AAC编码格式支持范围[1 - 8]。
207
+
208
+ - G711-mulaw编码格式支持范围[1 - 1]。
209
+
210
+ - MP3编码格式支持范围[1 - 2]
211
+ */
212
+ AudioChannelsHarmony?: number;
213
+ }
214
+
215
+ export type RecordBackType = {
216
+ isRecording?: boolean;
217
+ currentPosition: number;
218
+ currentMetering?: number;
219
+ };
220
+
221
+ export type PlayBackType = {
222
+ isMuted?: boolean;
223
+ currentPosition: number;
224
+ duration: number;
225
+ isFinished: boolean;
226
+ };
227
+