@react-native-ohos/react-native-audio-recorder-player 3.7.0-rc.2 → 3.7.0
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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "@react-native-ohos/react-native-audio-recorder-player",
|
|
6
6
|
"description": "",
|
|
7
7
|
"main": "index.ets",
|
|
8
|
-
"version": "3.7.0
|
|
8
|
+
"version": "3.7.0",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
|
|
11
11
|
},
|
|
@@ -0,0 +1,210 @@
|
|
|
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
|
+
VIDEO_H263 = 'video/h263', // 表示视频/h263类型。
|
|
44
|
+
VIDEO_AVC = 'video/avc', // 表示视频/avc类型。
|
|
45
|
+
VIDEO_MPEG2 = 'video/mpeg2', // 表示视频/mpeg2类型。
|
|
46
|
+
VIDEO_MPEG4 = 'video/mp4v-es', // 表示视频/mpeg4类型。
|
|
47
|
+
VIDEO_VP8 = 'video/x-vnd.on2.vp8', // 表示视频/vp8类型。
|
|
48
|
+
VIDEO_HEVC = 'video/hevc', // 表示视频/H265类型。
|
|
49
|
+
AUDIO_AAC = 'audio/mp4a-latm', // 表示音频/mp4a-latm类型。
|
|
50
|
+
|
|
51
|
+
AUDIO_VORBIS = 'audio/vorbis', // 表示音频/vorbis类型。
|
|
52
|
+
AUDIO_FLAC = 'audio/flac', // 表示音频/flac类型。
|
|
53
|
+
AUDIO_MP3 = 'audio/mpeg', // 表示音频/mpeg类型。
|
|
54
|
+
AUDIO_G711MU = 'audio/g711mu', // 表示音频/G711-mulaw类型。
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export enum AudioSourceAndroidType {
|
|
58
|
+
DEFAULT = 0,
|
|
59
|
+
MIC,
|
|
60
|
+
VOICE_UPLINK,
|
|
61
|
+
VOICE_DOWNLINK,
|
|
62
|
+
VOICE_CALL,
|
|
63
|
+
CAMCORDER,
|
|
64
|
+
VOICE_RECOGNITION,
|
|
65
|
+
VOICE_COMMUNICATION,
|
|
66
|
+
REMOTE_SUBMIX,
|
|
67
|
+
UNPROCESSED,
|
|
68
|
+
RADIO_TUNER = 1998,
|
|
69
|
+
HOTWORD,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export enum OutputFormatAndroidType {
|
|
73
|
+
DEFAULT = 0,
|
|
74
|
+
THREE_GPP,
|
|
75
|
+
MPEG_4,
|
|
76
|
+
AMR_NB,
|
|
77
|
+
AMR_WB,
|
|
78
|
+
AAC_ADIF,
|
|
79
|
+
AAC_ADTS,
|
|
80
|
+
OUTPUT_FORMAT_RTP_AVP,
|
|
81
|
+
MPEG_2_TS,
|
|
82
|
+
WEBM,
|
|
83
|
+
UNUSED,
|
|
84
|
+
OGG,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export enum AudioEncoderAndroidType {
|
|
88
|
+
DEFAULT = 0,
|
|
89
|
+
AMR_NB,
|
|
90
|
+
AMR_WB,
|
|
91
|
+
AAC,
|
|
92
|
+
HE_AAC,
|
|
93
|
+
AAC_ELD,
|
|
94
|
+
VORBIS,
|
|
95
|
+
OPUS,
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export enum AVEncodingOption {
|
|
99
|
+
lpcm = 'lpcm',
|
|
100
|
+
ima4 = 'ima4',
|
|
101
|
+
aac = 'aac',
|
|
102
|
+
MAC3 = 'MAC3',
|
|
103
|
+
MAC6 = 'MAC6',
|
|
104
|
+
ulaw = 'ulaw',
|
|
105
|
+
alaw = 'alaw',
|
|
106
|
+
mp1 = 'mp1',
|
|
107
|
+
mp2 = 'mp2',
|
|
108
|
+
mp4 = 'mp4',
|
|
109
|
+
alac = 'alac',
|
|
110
|
+
amr = 'amr',
|
|
111
|
+
flac = 'flac',
|
|
112
|
+
opus = 'opus',
|
|
113
|
+
wav = 'wav',
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type AVEncodingType =
|
|
117
|
+
| AVEncodingOption.lpcm
|
|
118
|
+
| AVEncodingOption.ima4
|
|
119
|
+
| AVEncodingOption.aac
|
|
120
|
+
| AVEncodingOption.MAC3
|
|
121
|
+
| AVEncodingOption.MAC6
|
|
122
|
+
| AVEncodingOption.ulaw
|
|
123
|
+
| AVEncodingOption.alaw
|
|
124
|
+
| AVEncodingOption.mp1
|
|
125
|
+
| AVEncodingOption.mp2
|
|
126
|
+
| AVEncodingOption.mp4
|
|
127
|
+
| AVEncodingOption.alac
|
|
128
|
+
| AVEncodingOption.amr
|
|
129
|
+
| AVEncodingOption.flac
|
|
130
|
+
| AVEncodingOption.opus
|
|
131
|
+
| AVEncodingOption.wav;
|
|
132
|
+
|
|
133
|
+
export enum AVModeIOSOption {
|
|
134
|
+
gamechat = 'gamechat',
|
|
135
|
+
measurement = 'measurement',
|
|
136
|
+
movieplayback = 'movieplayback',
|
|
137
|
+
spokenaudio = 'spokenaudio',
|
|
138
|
+
videochat = 'videochat',
|
|
139
|
+
videorecording = 'videorecording',
|
|
140
|
+
voicechat = 'voicechat',
|
|
141
|
+
voiceprompt = 'voiceprompt',
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export type AVModeIOSType =
|
|
145
|
+
| AVModeIOSOption.gamechat
|
|
146
|
+
| AVModeIOSOption.measurement
|
|
147
|
+
| AVModeIOSOption.movieplayback
|
|
148
|
+
| AVModeIOSOption.spokenaudio
|
|
149
|
+
| AVModeIOSOption.videochat
|
|
150
|
+
| AVModeIOSOption.videorecording
|
|
151
|
+
| AVModeIOSOption.voicechat
|
|
152
|
+
| AVModeIOSOption.voiceprompt;
|
|
153
|
+
|
|
154
|
+
export enum AVEncoderAudioQualityIOSType {
|
|
155
|
+
min = 0,
|
|
156
|
+
low = 32,
|
|
157
|
+
medium = 64,
|
|
158
|
+
high = 96,
|
|
159
|
+
max = 127,
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export enum AVLinearPCMBitDepthKeyIOSType {
|
|
163
|
+
'bit8' = 8,
|
|
164
|
+
'bit16' = 16,
|
|
165
|
+
'bit24' = 24,
|
|
166
|
+
'bit32' = 32,
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface AudioSet {
|
|
170
|
+
AVSampleRateKeyIOS?: number;
|
|
171
|
+
AVFormatIDKeyIOS?: AVEncodingType;
|
|
172
|
+
AVModeIOS?: AVModeIOSType;
|
|
173
|
+
AVNumberOfChannelsKeyIOS?: number;
|
|
174
|
+
AVEncoderAudioQualityKeyIOS?: AVEncoderAudioQualityIOSType;
|
|
175
|
+
AudioSourceAndroid?: AudioSourceAndroidType;
|
|
176
|
+
AVLinearPCMBitDepthKeyIOS?: AVLinearPCMBitDepthKeyIOSType;
|
|
177
|
+
AVLinearPCMIsBigEndianKeyIOS?: boolean;
|
|
178
|
+
AVLinearPCMIsFloatKeyIOS?: boolean;
|
|
179
|
+
AVLinearPCMIsNonInterleavedIOS?: boolean;
|
|
180
|
+
AVEncoderBitRateKeyIOS?: number;
|
|
181
|
+
OutputFormatAndroid?: OutputFormatAndroidType;
|
|
182
|
+
AudioEncoderAndroid?: AudioEncoderAndroidType;
|
|
183
|
+
AudioEncodingBitRateAndroid?: number;
|
|
184
|
+
AudioSamplingRateAndroid?: number;
|
|
185
|
+
AudioChannelsAndroid?: number;
|
|
186
|
+
AudioSourceHarmony?: AudioSourceHarmonyType;
|
|
187
|
+
AudioMimeHarmony?: AudioMimeHarmonyType;
|
|
188
|
+
AudioFileFormatHarmony?: AudioFormatHarmonyType;
|
|
189
|
+
AudioEncodingBitRateHarmony?: number;
|
|
190
|
+
AudioSamplingRateHarmony?: number;
|
|
191
|
+
AudioChannelsHarmony?: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export type RecordBackType = {
|
|
195
|
+
isRecording?: boolean;
|
|
196
|
+
currentPosition: number;
|
|
197
|
+
currentMetering?: number;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export type PlayBackType = {
|
|
201
|
+
isMuted?: boolean;
|
|
202
|
+
currentPosition: number;
|
|
203
|
+
duration: number;
|
|
204
|
+
isFinished: boolean;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export enum harmonyEventName {
|
|
208
|
+
recordBack = 'rn-recordback',
|
|
209
|
+
playBack = 'rn-playback'
|
|
210
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-audio-recorder-player",
|
|
3
|
-
"version": "3.7.0
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "React Native Audio Recorder and Player.",
|
|
5
5
|
"homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-audio-recorder-player",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
"src",
|
|
32
32
|
"harmony",
|
|
33
33
|
"index.ts",
|
|
34
|
-
"index.d.ts"
|
|
35
|
-
"RNAudioRecorderPlayer.podspec"
|
|
34
|
+
"index.d.ts"
|
|
36
35
|
],
|
|
37
36
|
"author": "dooboolab",
|
|
38
37
|
"license": "MIT",
|
|
@@ -57,3 +56,4 @@
|
|
|
57
56
|
"typescript": "^4.9.4"
|
|
58
57
|
}
|
|
59
58
|
}
|
|
59
|
+
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "RNAudioRecorderPlayer"
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.license = package['license']
|
|
10
|
-
|
|
11
|
-
s.authors = package['author']
|
|
12
|
-
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, "11.0"
|
|
14
|
-
s.ios.deployment_target = "10.0"
|
|
15
|
-
|
|
16
|
-
s.source = { :git => "https://github.com/hyochan/react-native-audio-recorder-player.git", :tag => "#{s.version}" }
|
|
17
|
-
s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
|
|
18
|
-
|
|
19
|
-
s.dependency 'React-Core'
|
|
20
|
-
end
|
|
21
|
-
|