expo-audio 0.2.1 → 0.2.2
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.
- package/CHANGELOG.md +4 -0
- package/android/build.gradle +2 -2
- package/build/Audio.types.d.ts +10 -12
- package/build/Audio.types.d.ts.map +1 -1
- package/build/Audio.types.js.map +1 -1
- package/build/AudioModule.types.d.ts +4 -4
- package/build/AudioModule.types.d.ts.map +1 -1
- package/build/AudioModule.types.js.map +1 -1
- package/package.json +2 -2
- package/src/Audio.types.ts +10 -12
- package/src/AudioModule.types.ts +4 -4
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'expo.modules.audio'
|
|
4
|
-
version = '0.2.
|
|
4
|
+
version = '0.2.2'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,7 +14,7 @@ android {
|
|
|
14
14
|
namespace "expo.modules.audio"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 1
|
|
17
|
-
versionName "0.2.
|
|
17
|
+
versionName "0.2.2"
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
compileOptions {
|
package/build/Audio.types.d.ts
CHANGED
|
@@ -96,25 +96,25 @@ export type RecordingOptions = {
|
|
|
96
96
|
/**
|
|
97
97
|
* The desired file extension.
|
|
98
98
|
*
|
|
99
|
-
* @example
|
|
99
|
+
* @example .caf
|
|
100
100
|
*/
|
|
101
101
|
extension: string;
|
|
102
102
|
/**
|
|
103
103
|
* The desired sample rate.
|
|
104
104
|
*
|
|
105
|
-
* @example
|
|
105
|
+
* @example 44100
|
|
106
106
|
*/
|
|
107
107
|
sampleRate: number;
|
|
108
108
|
/**
|
|
109
109
|
* The desired number of channels.
|
|
110
110
|
*
|
|
111
|
-
* @example
|
|
111
|
+
* @example 2
|
|
112
112
|
*/
|
|
113
113
|
numberOfChannels: number;
|
|
114
114
|
/**
|
|
115
115
|
* The desired bit rate.
|
|
116
116
|
*
|
|
117
|
-
* @example
|
|
117
|
+
* @example 128000
|
|
118
118
|
*/
|
|
119
119
|
bitRate: number;
|
|
120
120
|
/**
|
|
@@ -138,13 +138,13 @@ export type RecordingOptionsIos = {
|
|
|
138
138
|
/**
|
|
139
139
|
* The desired file extension.
|
|
140
140
|
*
|
|
141
|
-
* @example
|
|
141
|
+
* @example .caf
|
|
142
142
|
*/
|
|
143
143
|
extension?: string;
|
|
144
144
|
/**
|
|
145
145
|
* The desired sample rate.
|
|
146
146
|
*
|
|
147
|
-
* @example
|
|
147
|
+
* @example 44100
|
|
148
148
|
*/
|
|
149
149
|
sampleRate?: number;
|
|
150
150
|
/**
|
|
@@ -162,15 +162,13 @@ export type RecordingOptionsIos = {
|
|
|
162
162
|
/**
|
|
163
163
|
* The desired bit depth hint.
|
|
164
164
|
*
|
|
165
|
-
* @example
|
|
166
|
-
* `16`
|
|
165
|
+
* @example 16
|
|
167
166
|
*/
|
|
168
167
|
bitDepthHint?: number;
|
|
169
168
|
/**
|
|
170
169
|
* The desired PCM bit depth.
|
|
171
170
|
*
|
|
172
|
-
* @example
|
|
173
|
-
* `16`
|
|
171
|
+
* @example 16
|
|
174
172
|
*/
|
|
175
173
|
linearPCMBitDepth?: number;
|
|
176
174
|
/**
|
|
@@ -186,13 +184,13 @@ export type RecordingOptionsAndroid = {
|
|
|
186
184
|
/**
|
|
187
185
|
* The desired file extension.
|
|
188
186
|
*
|
|
189
|
-
* @example
|
|
187
|
+
* @example .caf
|
|
190
188
|
*/
|
|
191
189
|
extension?: string;
|
|
192
190
|
/**
|
|
193
191
|
* The desired sample rate.
|
|
194
192
|
*
|
|
195
|
-
* @example
|
|
193
|
+
* @example 44100
|
|
196
194
|
*/
|
|
197
195
|
sampleRate?: number;
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io.types.ts"],"names":[],"mappings":"AAqEA,MAAM,CAAN,IAAY,eAmCX;AAnCD,WAAY,eAAe;IACzB,qCAAkB,CAAA;IAClB,+BAAY,CAAA;IACZ,oCAAmB,CAAA;IACnB,qCAAkB,CAAA;IAClB,oCAAiB,CAAA;IACjB,qCAAkB,CAAA;IAClB,qCAAkB,CAAA;IAClB,uCAAoB,CAAA;IACpB,iCAAc,CAAA;IACd,iCAAc,CAAA;IACd,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,mCAAgB,CAAA;IAChB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,yCAAsB,CAAA;IACtB,uCAAoB,CAAA;IACpB,uCAAoB,CAAA;IACpB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,2CAAwB,CAAA;IACxB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,+BAAY,CAAA;IACZ,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,gCAAa,CAAA;IACb,4EAAwB,CAAA;IACxB,8EAAyB,CAAA;IACzB,gCAAa,CAAA;IACb,uCAAoB,CAAA;AACtB,CAAC,EAnCW,eAAe,KAAf,eAAe,QAmC1B;AAED,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,6CAAO,CAAA;IACP,8CAAU,CAAA;IACV,oDAAa,CAAA;IACb,gDAAW,CAAA;IACX,+CAAU,CAAA;AACZ,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB","sourcesContent":["export type AudioSource =\n | string\n | {\n /**\n * A string representing the resource identifier for the audio,\n * which could be an HTTPS address, a local file path, or the name of a static audio file resource.\n */\n uri?: string;\n /**\n * An object representing the HTTP headers to send along with the request for a remote audio source.\n * On web requires the `Access-Control-Allow-Origin` header returned by the server to include the current domain.\n */\n headers?: Record<string, string>;\n }\n | null;\n\nexport type RecordingInput = {\n name: string;\n type: string;\n uid: string;\n};\n\nexport type PitchCorrectionQuality = 'low' | 'medium' | 'high';\n\nexport type AudioStatus = {\n id: number;\n currentTime: number;\n playbackState: string;\n timeControlStatus: string;\n reasonForWaitingToPlay: string;\n mute: boolean;\n duration: number;\n playing: boolean;\n loop: boolean;\n isBuffering: boolean;\n isLoaded: boolean;\n playbackRate: number;\n shouldCorrectPitch: boolean;\n};\n\nexport type RecordingStatus = {\n id: number;\n isFinished: boolean;\n hasError: boolean;\n error: string | null;\n url: string | null;\n};\n\nexport type RecorderState = {\n canRecord: boolean;\n isRecording: boolean;\n durationMillis: number;\n mediaServicesDidReset: boolean;\n metering?: number;\n url: string | null;\n};\n\nexport type AndroidOutputFormat =\n | 'default'\n | '3gp'\n | 'mpeg4'\n | 'amrnb'\n | 'amrwb'\n | 'aac_adts'\n | 'mpeg2ts'\n | 'webm';\n\nexport type AndroidAudioEncoder = 'default' | 'amr_nb' | 'amr_wb' | 'aac' | 'he_aac' | 'aac_eld';\n\nexport enum IOSOutputFormat {\n LINEARPCM = 'lpcm',\n AC3 = 'ac-3',\n '60958AC3' = 'cac3',\n APPLEIMA4 = 'ima4',\n MPEG4AAC = 'aac ',\n MPEG4CELP = 'celp',\n MPEG4HVXC = 'hvxc',\n MPEG4TWINVQ = 'twvq',\n MACE3 = 'MAC3',\n MACE6 = 'MAC6',\n ULAW = 'ulaw',\n ALAW = 'alaw',\n QDESIGN = 'QDMC',\n QDESIGN2 = 'QDM2',\n QUALCOMM = 'Qclp',\n MPEGLAYER1 = '.mp1',\n MPEGLAYER2 = '.mp2',\n MPEGLAYER3 = '.mp3',\n APPLELOSSLESS = 'alac',\n MPEG4AAC_HE = 'aach',\n MPEG4AAC_LD = 'aacl',\n MPEG4AAC_ELD = 'aace',\n MPEG4AAC_ELD_SBR = 'aacf',\n MPEG4AAC_ELD_V2 = 'aacg',\n MPEG4AAC_HE_V2 = 'aacp',\n MPEG4AAC_SPATIAL = 'aacs',\n AMR = 'samr',\n AMR_WB = 'sawb',\n AUDIBLE = 'AUDB',\n ILBC = 'ilbc',\n DVIINTELIMA = 0x6d730011,\n MICROSOFTGSM = 0x6d730031,\n AES3 = 'aes3',\n ENHANCEDAC3 = 'ec-3',\n}\n\nexport enum AudioQuality {\n MIN = 0,\n LOW = 0x20,\n MEDIUM = 0x40,\n HIGH = 0x60,\n MAX = 0x7f,\n}\n\nexport type BitRateStrategy = 'constant' | 'longTermAverage' | 'variableConstrained' | 'variable';\n\nexport type RecordingOptions = {\n /**\n * The desired file extension.\n *\n * @example
|
|
1
|
+
{"version":3,"file":"Audio.types.js","sourceRoot":"","sources":["../src/Audio.types.ts"],"names":[],"mappings":"AAqEA,MAAM,CAAN,IAAY,eAmCX;AAnCD,WAAY,eAAe;IACzB,qCAAkB,CAAA;IAClB,+BAAY,CAAA;IACZ,oCAAmB,CAAA;IACnB,qCAAkB,CAAA;IAClB,oCAAiB,CAAA;IACjB,qCAAkB,CAAA;IAClB,qCAAkB,CAAA;IAClB,uCAAoB,CAAA;IACpB,iCAAc,CAAA;IACd,iCAAc,CAAA;IACd,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,mCAAgB,CAAA;IAChB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,yCAAsB,CAAA;IACtB,uCAAoB,CAAA;IACpB,uCAAoB,CAAA;IACpB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,2CAAwB,CAAA;IACxB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,+BAAY,CAAA;IACZ,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,gCAAa,CAAA;IACb,4EAAwB,CAAA;IACxB,8EAAyB,CAAA;IACzB,gCAAa,CAAA;IACb,uCAAoB,CAAA;AACtB,CAAC,EAnCW,eAAe,KAAf,eAAe,QAmC1B;AAED,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,6CAAO,CAAA;IACP,8CAAU,CAAA;IACV,oDAAa,CAAA;IACb,gDAAW,CAAA;IACX,+CAAU,CAAA;AACZ,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB","sourcesContent":["export type AudioSource =\n | string\n | {\n /**\n * A string representing the resource identifier for the audio,\n * which could be an HTTPS address, a local file path, or the name of a static audio file resource.\n */\n uri?: string;\n /**\n * An object representing the HTTP headers to send along with the request for a remote audio source.\n * On web requires the `Access-Control-Allow-Origin` header returned by the server to include the current domain.\n */\n headers?: Record<string, string>;\n }\n | null;\n\nexport type RecordingInput = {\n name: string;\n type: string;\n uid: string;\n};\n\nexport type PitchCorrectionQuality = 'low' | 'medium' | 'high';\n\nexport type AudioStatus = {\n id: number;\n currentTime: number;\n playbackState: string;\n timeControlStatus: string;\n reasonForWaitingToPlay: string;\n mute: boolean;\n duration: number;\n playing: boolean;\n loop: boolean;\n isBuffering: boolean;\n isLoaded: boolean;\n playbackRate: number;\n shouldCorrectPitch: boolean;\n};\n\nexport type RecordingStatus = {\n id: number;\n isFinished: boolean;\n hasError: boolean;\n error: string | null;\n url: string | null;\n};\n\nexport type RecorderState = {\n canRecord: boolean;\n isRecording: boolean;\n durationMillis: number;\n mediaServicesDidReset: boolean;\n metering?: number;\n url: string | null;\n};\n\nexport type AndroidOutputFormat =\n | 'default'\n | '3gp'\n | 'mpeg4'\n | 'amrnb'\n | 'amrwb'\n | 'aac_adts'\n | 'mpeg2ts'\n | 'webm';\n\nexport type AndroidAudioEncoder = 'default' | 'amr_nb' | 'amr_wb' | 'aac' | 'he_aac' | 'aac_eld';\n\nexport enum IOSOutputFormat {\n LINEARPCM = 'lpcm',\n AC3 = 'ac-3',\n '60958AC3' = 'cac3',\n APPLEIMA4 = 'ima4',\n MPEG4AAC = 'aac ',\n MPEG4CELP = 'celp',\n MPEG4HVXC = 'hvxc',\n MPEG4TWINVQ = 'twvq',\n MACE3 = 'MAC3',\n MACE6 = 'MAC6',\n ULAW = 'ulaw',\n ALAW = 'alaw',\n QDESIGN = 'QDMC',\n QDESIGN2 = 'QDM2',\n QUALCOMM = 'Qclp',\n MPEGLAYER1 = '.mp1',\n MPEGLAYER2 = '.mp2',\n MPEGLAYER3 = '.mp3',\n APPLELOSSLESS = 'alac',\n MPEG4AAC_HE = 'aach',\n MPEG4AAC_LD = 'aacl',\n MPEG4AAC_ELD = 'aace',\n MPEG4AAC_ELD_SBR = 'aacf',\n MPEG4AAC_ELD_V2 = 'aacg',\n MPEG4AAC_HE_V2 = 'aacp',\n MPEG4AAC_SPATIAL = 'aacs',\n AMR = 'samr',\n AMR_WB = 'sawb',\n AUDIBLE = 'AUDB',\n ILBC = 'ilbc',\n DVIINTELIMA = 0x6d730011,\n MICROSOFTGSM = 0x6d730031,\n AES3 = 'aes3',\n ENHANCEDAC3 = 'ec-3',\n}\n\nexport enum AudioQuality {\n MIN = 0,\n LOW = 0x20,\n MEDIUM = 0x40,\n HIGH = 0x60,\n MAX = 0x7f,\n}\n\nexport type BitRateStrategy = 'constant' | 'longTermAverage' | 'variableConstrained' | 'variable';\n\nexport type RecordingOptions = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate: number;\n /**\n * The desired number of channels.\n *\n * @example 2\n */\n numberOfChannels: number;\n /**\n * The desired bit rate.\n *\n * @example 128000\n */\n bitRate: number;\n /**\n * Recording options for the Android platform.\n */\n android: RecordingOptionsAndroid;\n /**\n * Recording options for the iOS platform.\n */\n ios: RecordingOptionsIos;\n /**\n * Recording options for the Web platform.\n */\n web?: RecordingOptionsWeb;\n};\n\nexport type RecordingOptionsWeb = {\n mimeType?: string;\n bitsPerSecond?: number;\n};\n\nexport type RecordingOptionsIos = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`IOSOutputFormat`](#iosoutputformat) enum for all valid values.\n */\n outputFormat?: string | IOSOutputFormat | number;\n /**\n * The desired audio quality. See the [`IOSAudioQuality`](#iosaudioquality) enum for all valid values.\n */\n audioQuality: AudioQuality | number;\n /**\n * The desired bit rate strategy. See the next section for an enumeration of all valid values of `bitRateStrategy`.\n */\n bitRateStrategy?: number;\n /**\n * The desired bit depth hint.\n *\n * @example 16\n */\n bitDepthHint?: number;\n /**\n * The desired PCM bit depth.\n *\n * @example 16\n */\n linearPCMBitDepth?: number;\n /**\n * A boolean describing if the PCM data should be formatted in big endian.\n */\n linearPCMIsBigEndian?: boolean;\n /**\n * A boolean describing if the PCM data should be encoded in floating point or integral values.\n */\n linearPCMIsFloat?: boolean;\n};\n\nexport type RecordingOptionsAndroid = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`AndroidOutputFormat`](#androidoutputformat) enum for all valid values.\n */\n outputFormat: AndroidOutputFormat;\n /**\n * The desired audio encoder. See the [`AndroidAudioEncoder`](#androidaudioencoder) enum for all valid values.\n */\n audioEncoder: AndroidAudioEncoder;\n /**\n * The desired maximum file size in bytes, after which the recording will stop (but `stopAndUnloadAsync()` must still\n * be called after this point).\n *\n * @example\n * `65536`\n */\n maxFileSize?: number;\n};\n\nexport type AudioMode = {\n playsInSilentMode: boolean;\n interruptionMode: InterruptionMode;\n allowsRecording: boolean;\n shouldPlayInBackground: boolean;\n shouldRouteThroughEarpiece: boolean;\n};\n\nexport type InterruptionMode = 'mixWithOthers' | 'doNotMix' | 'duckOthers';\n"]}
|
|
@@ -52,7 +52,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
52
52
|
*/
|
|
53
53
|
currentTime: number;
|
|
54
54
|
/**
|
|
55
|
-
* The total duration of the audio
|
|
55
|
+
* The total duration of the audio in seconds.
|
|
56
56
|
*/
|
|
57
57
|
duration: number;
|
|
58
58
|
/**
|
|
@@ -73,7 +73,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
73
73
|
*/
|
|
74
74
|
currentStatus: AudioStatus;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Start playing audio.
|
|
77
77
|
*/
|
|
78
78
|
play(): void;
|
|
79
79
|
/**
|
|
@@ -90,7 +90,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
90
90
|
* @param rate The playback rate of the audio.
|
|
91
91
|
* @param pitchCorrectionQuality The quality of the pitch correction.
|
|
92
92
|
*/
|
|
93
|
-
setPlaybackRate(
|
|
93
|
+
setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;
|
|
94
94
|
/**
|
|
95
95
|
*
|
|
96
96
|
* @hidden
|
|
@@ -160,7 +160,7 @@ export declare class AudioRecorder extends SharedObject<RecordingEvents> {
|
|
|
160
160
|
* @param inputUid The uid of a `RecordingInput`.
|
|
161
161
|
* @return A `Promise` that is resolved if successful or rejected if not.
|
|
162
162
|
*/
|
|
163
|
-
setInput(
|
|
163
|
+
setInput(inputUid: string): void;
|
|
164
164
|
/**
|
|
165
165
|
* Status of the current recording.
|
|
166
166
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioModule.types.d.ts","sourceRoot":"","sources":["../src/AudioModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/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AI,CAAC;IAErB;;OAEG;IACH,KAAK,IAAI,IAAI;IAEb;;;OAGG;IACH,kBAAkB,IAAI,cAAc,EAAE;IAEtC;;;OAGG;IACH,eAAe,IAAI,cAAc;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAEhC;;OAEG;IACH,SAAS,IAAI,aAAa;IAE1B;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAE3C;;OAEG;IACH,oBAAoB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAExE;;;OAGG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CACzC;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,qBAAqB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CAC1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioModule.types.js","sourceRoot":"","sources":["../src/AudioModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["import { PermissionResponse, SharedObject } from 'expo-modules-core';\n\nimport {\n AudioMode,\n AudioSource,\n AudioStatus,\n PitchCorrectionQuality,\n RecorderState,\n RecordingInput,\n RecordingOptions,\n RecordingStatus,\n} from './Audio.types';\n\nexport interface AudioModule {\n setIsAudioActiveAsync(active: boolean): Promise<void>;\n setAudioModeAsync(category: Partial<AudioMode>): Promise<void>;\n requestRecordingPermissionsAsync(): Promise<RecordingPermissionResponse>;\n getRecordingPermissionsAsync(): Promise<RecordingPermissionResponse>;\n\n readonly AudioPlayer: typeof AudioPlayer;\n readonly AudioRecorder: typeof AudioRecorder;\n}\n\nexport type RecordingPermissionResponse = PermissionResponse;\n\nexport declare class AudioPlayer extends SharedObject<AudioEvents> {\n /**\n * Initializes a new audio player instance with the given source.\n * @hidden\n */\n constructor(source: AudioSource, updateInterval: number);\n\n /**\n * Unique identifier for the player object.\n */\n id: number;\n\n /**\n * Boolean value indicating whether the player is currently playing.\n */\n playing: boolean;\n\n /**\n * Boolean value indicating whether the player is currently muted.\n */\n muted: boolean;\n\n /**\n * Boolean value indicating whether the player is currently looping.\n */\n loop: boolean;\n\n /**\n * Boolean value indicating whether the player is currently paused.\n */\n paused: boolean;\n\n /**\n * Boolean value indicating whether the player is finished loading.\n */\n isLoaded: boolean;\n\n /**\n * Boolean value indicating whether audio sampling is supported on the platform.\n */\n isAudioSamplingSupported: boolean;\n\n /**\n * Boolean value indicating whether the player is buffering.\n */\n isBuffering: boolean;\n\n /**\n * The current position through the audio item, in seconds.\n */\n currentTime: number;\n\n /**\n * The total duration of the audio
|
|
1
|
+
{"version":3,"file":"AudioModule.types.js","sourceRoot":"","sources":["../src/AudioModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["import { PermissionResponse, SharedObject } from 'expo-modules-core';\n\nimport {\n AudioMode,\n AudioSource,\n AudioStatus,\n PitchCorrectionQuality,\n RecorderState,\n RecordingInput,\n RecordingOptions,\n RecordingStatus,\n} from './Audio.types';\n\nexport interface AudioModule {\n setIsAudioActiveAsync(active: boolean): Promise<void>;\n setAudioModeAsync(category: Partial<AudioMode>): Promise<void>;\n requestRecordingPermissionsAsync(): Promise<RecordingPermissionResponse>;\n getRecordingPermissionsAsync(): Promise<RecordingPermissionResponse>;\n\n readonly AudioPlayer: typeof AudioPlayer;\n readonly AudioRecorder: typeof AudioRecorder;\n}\n\nexport type RecordingPermissionResponse = PermissionResponse;\n\nexport declare class AudioPlayer extends SharedObject<AudioEvents> {\n /**\n * Initializes a new audio player instance with the given source.\n * @hidden\n */\n constructor(source: AudioSource, updateInterval: number);\n\n /**\n * Unique identifier for the player object.\n */\n id: number;\n\n /**\n * Boolean value indicating whether the player is currently playing.\n */\n playing: boolean;\n\n /**\n * Boolean value indicating whether the player is currently muted.\n */\n muted: boolean;\n\n /**\n * Boolean value indicating whether the player is currently looping.\n */\n loop: boolean;\n\n /**\n * Boolean value indicating whether the player is currently paused.\n */\n paused: boolean;\n\n /**\n * Boolean value indicating whether the player is finished loading.\n */\n isLoaded: boolean;\n\n /**\n * Boolean value indicating whether audio sampling is supported on the platform.\n */\n isAudioSamplingSupported: boolean;\n\n /**\n * Boolean value indicating whether the player is buffering.\n */\n isBuffering: boolean;\n\n /**\n * The current position through the audio item, in seconds.\n */\n currentTime: number;\n\n /**\n * The total duration of the audio in seconds.\n */\n duration: number;\n\n /**\n * The current volume of the audio.\n */\n volume: number;\n\n /**\n * The current playback rate of the audio.\n */\n playbackRate: number;\n\n /**\n * A boolean describing if we are correcting the pitch for a changed rate.\n */\n shouldCorrectPitch: boolean;\n\n /**\n * The current status of the audio player.\n * @hidden\n */\n currentStatus: AudioStatus;\n\n /**\n * Start playing audio.\n */\n play(): void;\n\n /**\n * Pauses the player.\n */\n pause(): void;\n\n /**\n * Seeks the playback by the given number of seconds.\n * @param seconds The number of seconds to seek by.\n */\n seekTo(seconds: number): Promise<void>;\n\n /**\n * Sets the current playback rate of the audio.\n * @param rate The playback rate of the audio.\n * @param pitchCorrectionQuality The quality of the pitch correction.\n */\n setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;\n\n /**\n *\n * @hidden\n */\n setAudioSamplingEnabled(enabled: boolean): void;\n\n /**\n * Remove the player from memory to free up resources.\n */\n remove(): void;\n}\n\ntype AudioSample = {\n channels: { frames: number[] }[];\n timestamp: number;\n};\n\nexport type AudioEvents = {\n playbackStatusUpdate(status: AudioStatus): void;\n audioSampleUpdate(data: AudioSample): void;\n};\n\nexport declare class AudioRecorder extends SharedObject<RecordingEvents> {\n /**\n * Initializes a new audio recorder instance with the given source.\n * @hidden\n */\n constructor(options: Partial<RecordingOptions>);\n\n /**\n * Unique identifier for the recorder object.\n */\n id: number;\n\n /**\n * The current length of the recording, in seconds.\n */\n currentTime: number;\n\n /**\n * Boolean value indicating whether the recording is in progress.\n */\n isRecording: boolean;\n\n /**\n * The uri of the recording.\n */\n uri: string | null;\n\n /**\n * Starts the recording.\n */\n record(): void;\n\n /**\n * Stop the recording.\n */\n stop(): Promise<void>;\n\n /**\n * Pause the recording.\n */\n pause(): void;\n\n /**\n * Returns a list of available recording inputs. This method can only be called if the `Recording` has been prepared.\n * @return A `Promise` that is fulfilled with an array of `RecordingInput` objects.\n */\n getAvailableInputs(): RecordingInput[];\n\n /**\n * Returns the currently-selected recording input. This method can only be called if the `Recording` has been prepared.\n * @return A `Promise` that is fulfilled with a `RecordingInput` object.\n */\n getCurrentInput(): RecordingInput;\n\n /**\n * Sets the current recording input.\n * @param inputUid The uid of a `RecordingInput`.\n * @return A `Promise` that is resolved if successful or rejected if not.\n */\n setInput(inputUid: string): void;\n\n /**\n * Status of the current recording.\n */\n getStatus(): RecorderState;\n\n /**\n * Starts the recording at the given time.\n * @param seconds The time in seconds to start recording at.\n */\n startRecordingAtTime(seconds: number): void;\n\n /**\n * Prepares the recording for recording.\n */\n prepareToRecordAsync(options?: Partial<RecordingOptions>): Promise<void>;\n\n /**\n * Stops the recording once the specified time has elapsed.\n * @param seconds The time in seconds to stop recording at.\n */\n recordForDuration(seconds: number): void;\n}\n\nexport type RecordingEvents = {\n recordingStatusUpdate: (status: RecordingStatus) => void;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-audio",
|
|
3
3
|
"title": "Expo Audio",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"description": "A cross-platform audio library for React Native and Expo apps.",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react": "*",
|
|
41
41
|
"react-native": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2e4f18d41da033c5ced0a4a045d91cf5250016b7"
|
|
44
44
|
}
|
package/src/Audio.types.ts
CHANGED
|
@@ -118,25 +118,25 @@ export type RecordingOptions = {
|
|
|
118
118
|
/**
|
|
119
119
|
* The desired file extension.
|
|
120
120
|
*
|
|
121
|
-
* @example
|
|
121
|
+
* @example .caf
|
|
122
122
|
*/
|
|
123
123
|
extension: string;
|
|
124
124
|
/**
|
|
125
125
|
* The desired sample rate.
|
|
126
126
|
*
|
|
127
|
-
* @example
|
|
127
|
+
* @example 44100
|
|
128
128
|
*/
|
|
129
129
|
sampleRate: number;
|
|
130
130
|
/**
|
|
131
131
|
* The desired number of channels.
|
|
132
132
|
*
|
|
133
|
-
* @example
|
|
133
|
+
* @example 2
|
|
134
134
|
*/
|
|
135
135
|
numberOfChannels: number;
|
|
136
136
|
/**
|
|
137
137
|
* The desired bit rate.
|
|
138
138
|
*
|
|
139
|
-
* @example
|
|
139
|
+
* @example 128000
|
|
140
140
|
*/
|
|
141
141
|
bitRate: number;
|
|
142
142
|
/**
|
|
@@ -162,13 +162,13 @@ export type RecordingOptionsIos = {
|
|
|
162
162
|
/**
|
|
163
163
|
* The desired file extension.
|
|
164
164
|
*
|
|
165
|
-
* @example
|
|
165
|
+
* @example .caf
|
|
166
166
|
*/
|
|
167
167
|
extension?: string;
|
|
168
168
|
/**
|
|
169
169
|
* The desired sample rate.
|
|
170
170
|
*
|
|
171
|
-
* @example
|
|
171
|
+
* @example 44100
|
|
172
172
|
*/
|
|
173
173
|
sampleRate?: number;
|
|
174
174
|
/**
|
|
@@ -186,15 +186,13 @@ export type RecordingOptionsIos = {
|
|
|
186
186
|
/**
|
|
187
187
|
* The desired bit depth hint.
|
|
188
188
|
*
|
|
189
|
-
* @example
|
|
190
|
-
* `16`
|
|
189
|
+
* @example 16
|
|
191
190
|
*/
|
|
192
191
|
bitDepthHint?: number;
|
|
193
192
|
/**
|
|
194
193
|
* The desired PCM bit depth.
|
|
195
194
|
*
|
|
196
|
-
* @example
|
|
197
|
-
* `16`
|
|
195
|
+
* @example 16
|
|
198
196
|
*/
|
|
199
197
|
linearPCMBitDepth?: number;
|
|
200
198
|
/**
|
|
@@ -211,13 +209,13 @@ export type RecordingOptionsAndroid = {
|
|
|
211
209
|
/**
|
|
212
210
|
* The desired file extension.
|
|
213
211
|
*
|
|
214
|
-
* @example
|
|
212
|
+
* @example .caf
|
|
215
213
|
*/
|
|
216
214
|
extension?: string;
|
|
217
215
|
/**
|
|
218
216
|
* The desired sample rate.
|
|
219
217
|
*
|
|
220
|
-
* @example
|
|
218
|
+
* @example 44100
|
|
221
219
|
*/
|
|
222
220
|
sampleRate?: number;
|
|
223
221
|
/**
|
package/src/AudioModule.types.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
76
76
|
currentTime: number;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* The total duration of the audio
|
|
79
|
+
* The total duration of the audio in seconds.
|
|
80
80
|
*/
|
|
81
81
|
duration: number;
|
|
82
82
|
|
|
@@ -102,7 +102,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
102
102
|
currentStatus: AudioStatus;
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* Start playing audio.
|
|
106
106
|
*/
|
|
107
107
|
play(): void;
|
|
108
108
|
|
|
@@ -122,7 +122,7 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
122
122
|
* @param rate The playback rate of the audio.
|
|
123
123
|
* @param pitchCorrectionQuality The quality of the pitch correction.
|
|
124
124
|
*/
|
|
125
|
-
setPlaybackRate(
|
|
125
|
+
setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
*
|
|
@@ -205,7 +205,7 @@ export declare class AudioRecorder extends SharedObject<RecordingEvents> {
|
|
|
205
205
|
* @param inputUid The uid of a `RecordingInput`.
|
|
206
206
|
* @return A `Promise` that is resolved if successful or rejected if not.
|
|
207
207
|
*/
|
|
208
|
-
setInput(
|
|
208
|
+
setInput(inputUid: string): void;
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* Status of the current recording.
|