@siteed/audio-studio 3.2.0 β 3.2.1-beta.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.
- package/android/src/main/java/net/siteed/audiostudio/AudioRecorderManager.kt +12 -12
- package/android/src/main/java/net/siteed/audiostudio/AudioRecordingService.kt +1 -1
- package/android/src/main/java/net/siteed/audiostudio/AudioStudioModule.kt +4 -4
- package/android/src/main/java/net/siteed/audiostudio/RecordingActionReceiver.kt +1 -1
- package/build/cjs/AudioRecorder.provider.js +3 -37
- package/build/cjs/AudioRecorder.provider.js.map +1 -1
- package/build/esm/AudioRecorder.provider.js +3 -4
- package/build/esm/AudioRecorder.provider.js.map +1 -1
- package/ios/AudioStudio.podspec +1 -1
- package/package.json +163 -163
- package/plugin/tsconfig.json +8 -2
- package/scripts/README.md +0 -58
|
@@ -225,7 +225,7 @@ class AudioRecorderManager(
|
|
|
225
225
|
override fun resolve(value: Any?) {
|
|
226
226
|
LogUtils.d(CLASS_NAME, "π Successfully reinitialized AudioRecord with new device")
|
|
227
227
|
}
|
|
228
|
-
override fun reject(code: String
|
|
228
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
229
229
|
LogUtils.e(CLASS_NAME, "π Failed to reinitialize AudioRecord: $message")
|
|
230
230
|
}
|
|
231
231
|
})) {
|
|
@@ -237,7 +237,7 @@ class AudioRecorderManager(
|
|
|
237
237
|
"isPaused" to true
|
|
238
238
|
))
|
|
239
239
|
}
|
|
240
|
-
override fun reject(code: String
|
|
240
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {}
|
|
241
241
|
})
|
|
242
242
|
return
|
|
243
243
|
}
|
|
@@ -253,7 +253,7 @@ class AudioRecorderManager(
|
|
|
253
253
|
"isPaused" to true
|
|
254
254
|
))
|
|
255
255
|
}
|
|
256
|
-
override fun reject(code: String
|
|
256
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {}
|
|
257
257
|
})
|
|
258
258
|
return
|
|
259
259
|
}
|
|
@@ -297,7 +297,7 @@ class AudioRecorderManager(
|
|
|
297
297
|
"error" to e.message
|
|
298
298
|
))
|
|
299
299
|
}
|
|
300
|
-
override fun reject(code: String
|
|
300
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {}
|
|
301
301
|
})
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -417,7 +417,7 @@ class AudioRecorderManager(
|
|
|
417
417
|
"isPaused" to true
|
|
418
418
|
))
|
|
419
419
|
}
|
|
420
|
-
override fun reject(code: String
|
|
420
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
421
421
|
LogUtils.e(CLASS_NAME, "Failed to pause recording on phone call", cause)
|
|
422
422
|
}
|
|
423
423
|
})
|
|
@@ -444,7 +444,7 @@ class AudioRecorderManager(
|
|
|
444
444
|
"isPaused" to false
|
|
445
445
|
))
|
|
446
446
|
}
|
|
447
|
-
override fun reject(code: String
|
|
447
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
448
448
|
LogUtils.e(CLASS_NAME, "Failed to resume recording after phone call", cause)
|
|
449
449
|
}
|
|
450
450
|
})
|
|
@@ -1226,7 +1226,7 @@ class AudioRecorderManager(
|
|
|
1226
1226
|
override fun resolve(value: Any?) {
|
|
1227
1227
|
LogUtils.d(CLASS_NAME, "βΊοΈ Successfully reinitialized AudioRecord for resumption")
|
|
1228
1228
|
}
|
|
1229
|
-
override fun reject(code: String
|
|
1229
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1230
1230
|
LogUtils.e(CLASS_NAME, "βΊοΈ Failed to reinitialize AudioRecord: $message")
|
|
1231
1231
|
// We'll let the main try-catch handle this error
|
|
1232
1232
|
throw IllegalStateException("Failed to reinitialize AudioRecord: $message")
|
|
@@ -1936,7 +1936,7 @@ class AudioRecorderManager(
|
|
|
1936
1936
|
"isPaused" to true
|
|
1937
1937
|
))
|
|
1938
1938
|
}
|
|
1939
|
-
override fun reject(code: String
|
|
1939
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1940
1940
|
LogUtils.e(CLASS_NAME, "Failed to pause recording on audio focus loss")
|
|
1941
1941
|
}
|
|
1942
1942
|
})
|
|
@@ -1959,7 +1959,7 @@ class AudioRecorderManager(
|
|
|
1959
1959
|
"isPaused" to false
|
|
1960
1960
|
))
|
|
1961
1961
|
}
|
|
1962
|
-
override fun reject(code: String
|
|
1962
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1963
1963
|
LogUtils.e(CLASS_NAME, "Failed to resume recording on audio focus gain")
|
|
1964
1964
|
}
|
|
1965
1965
|
})
|
|
@@ -2006,7 +2006,7 @@ class AudioRecorderManager(
|
|
|
2006
2006
|
"isPaused" to true
|
|
2007
2007
|
))
|
|
2008
2008
|
}
|
|
2009
|
-
override fun reject(code: String
|
|
2009
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
2010
2010
|
LogUtils.e(CLASS_NAME, "Failed to pause recording on audio focus loss")
|
|
2011
2011
|
}
|
|
2012
2012
|
})
|
|
@@ -2033,7 +2033,7 @@ class AudioRecorderManager(
|
|
|
2033
2033
|
"isPaused" to false
|
|
2034
2034
|
))
|
|
2035
2035
|
}
|
|
2036
|
-
override fun reject(code: String
|
|
2036
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
2037
2037
|
LogUtils.e(CLASS_NAME, "Failed to resume recording on audio focus gain")
|
|
2038
2038
|
}
|
|
2039
2039
|
})
|
|
@@ -2139,7 +2139,7 @@ class AudioRecorderManager(
|
|
|
2139
2139
|
// Check permissions - create a dummy promise to avoid rejections
|
|
2140
2140
|
val dummyPromise = object : Promise {
|
|
2141
2141
|
override fun resolve(value: Any?) {}
|
|
2142
|
-
override fun reject(code: String
|
|
2142
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
2143
2143
|
LogUtils.e(CLASS_NAME, "Preparation error: $code - $message", cause)
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
@@ -101,7 +101,7 @@ class AudioRecordingService : Service() {
|
|
|
101
101
|
Log.d(Constants.TAG, "Successfully stopped recording on task removed")
|
|
102
102
|
cleanup()
|
|
103
103
|
}
|
|
104
|
-
override fun reject(code: String
|
|
104
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
105
105
|
Log.e(Constants.TAG, "Failed to stop recording on task removed: $message")
|
|
106
106
|
cleanup()
|
|
107
107
|
}
|
|
@@ -252,7 +252,7 @@ class AudioStudioModule : Module(), EventSender, AudioStreamDecoderDelegate {
|
|
|
252
252
|
LogUtils.d(CLASS_NAME, "βΊοΈ resumeRecording completed successfully")
|
|
253
253
|
promise.resolve(value)
|
|
254
254
|
}
|
|
255
|
-
override fun reject(code: String
|
|
255
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
256
256
|
LogUtils.e(CLASS_NAME, "βΊοΈ resumeRecording failed: $code - $message", cause)
|
|
257
257
|
promise.reject(code, message, cause)
|
|
258
258
|
}
|
|
@@ -1294,7 +1294,7 @@ class AudioStudioModule : Module(), EventSender, AudioStreamDecoderDelegate {
|
|
|
1294
1294
|
"isPaused" to true
|
|
1295
1295
|
))
|
|
1296
1296
|
}
|
|
1297
|
-
override fun reject(code: String
|
|
1297
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1298
1298
|
LogUtils.e(CLASS_NAME, "π± Failed to pause recording after device disconnection: $message")
|
|
1299
1299
|
}
|
|
1300
1300
|
})
|
|
@@ -1314,7 +1314,7 @@ class AudioStudioModule : Module(), EventSender, AudioStreamDecoderDelegate {
|
|
|
1314
1314
|
"isPaused" to true
|
|
1315
1315
|
))
|
|
1316
1316
|
}
|
|
1317
|
-
override fun reject(code: String
|
|
1317
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1318
1318
|
LogUtils.e(CLASS_NAME, "π± Failed to pause recording after device disconnection: $message")
|
|
1319
1319
|
}
|
|
1320
1320
|
})
|
|
@@ -1336,7 +1336,7 @@ class AudioStudioModule : Module(), EventSender, AudioStreamDecoderDelegate {
|
|
|
1336
1336
|
"isPaused" to true
|
|
1337
1337
|
))
|
|
1338
1338
|
}
|
|
1339
|
-
override fun reject(code: String
|
|
1339
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
1340
1340
|
LogUtils.e(CLASS_NAME, "π± Failed to pause recording after device disconnection: $message")
|
|
1341
1341
|
}
|
|
1342
1342
|
})
|
|
@@ -41,7 +41,7 @@ class RecordingActionReceiver : BroadcastReceiver() {
|
|
|
41
41
|
isProcessingAction.set(false)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
override fun reject(code: String
|
|
44
|
+
override fun reject(code: String?, message: String?, cause: Throwable?) {
|
|
45
45
|
Log.e("RecordingActionReceiver", "$action failed: $message", cause)
|
|
46
46
|
isProcessingAction.set(false)
|
|
47
47
|
}
|
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.useSharedAudioRecorder = exports.AudioRecorderProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
5
|
// packages/audio-studio/src/AudioRecorder.provider.tsx
|
|
38
|
-
const react_1 =
|
|
6
|
+
const react_1 = require("react");
|
|
39
7
|
const useAudioRecorder_1 = require("./useAudioRecorder");
|
|
40
8
|
const initContext = {
|
|
41
9
|
isRecording: false,
|
|
@@ -62,9 +30,7 @@ const initContext = {
|
|
|
62
30
|
const AudioRecorderContext = (0, react_1.createContext)(initContext);
|
|
63
31
|
const AudioRecorderProvider = ({ children, config = {}, }) => {
|
|
64
32
|
const audioRecorder = (0, useAudioRecorder_1.useAudioRecorder)(config);
|
|
65
|
-
return (
|
|
66
|
-
{children}
|
|
67
|
-
</AudioRecorderContext.Provider>);
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(AudioRecorderContext.Provider, { value: audioRecorder, children: children }));
|
|
68
34
|
};
|
|
69
35
|
exports.AudioRecorderProvider = AudioRecorderProvider;
|
|
70
36
|
const useSharedAudioRecorder = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioRecorder.provider.js","sourceRoot":"","sources":["../../src/AudioRecorder.provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AudioRecorder.provider.js","sourceRoot":"","sources":["../../src/AudioRecorder.provider.tsx"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,iCAAwD;AAGxD,yDAA4E;AAE5E,MAAM,WAAW,GAA0B;IACvC,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,aAAa,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,cAAc,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,eAAe,EAAE,KAAK,IAAI,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,gBAAgB,EAAE,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;CACJ,CAAA;AAED,MAAM,oBAAoB,GAAG,IAAA,qBAAa,EAAwB,WAAW,CAAC,CAAA;AAOvE,MAAM,qBAAqB,GAAyC,CAAC,EACxE,QAAQ,EACR,MAAM,GAAG,EAAE,GACd,EAAE,EAAE;IACD,MAAM,aAAa,GAAG,IAAA,mCAAgB,EAAC,MAAM,CAAC,CAAA;IAC9C,OAAO,CACH,uBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAC9C,QAAQ,GACmB,CACnC,CAAA;AACL,CAAC,CAAA;AAVY,QAAA,qBAAqB,yBAUjC;AAEM,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,oBAAoB,CAAC,CAAA;IAChD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACX,qEAAqE,CACxE,CAAA;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC,CAAA;AARY,QAAA,sBAAsB,0BAQlC","sourcesContent":["// packages/audio-studio/src/AudioRecorder.provider.tsx\nimport React, { createContext, useContext } from 'react'\n\nimport { UseAudioRecorderState } from './AudioStudio.types'\nimport { UseAudioRecorderProps, useAudioRecorder } from './useAudioRecorder'\n\nconst initContext: UseAudioRecorderState = {\n isRecording: false,\n isPaused: false,\n durationMs: 0,\n size: 0,\n compression: undefined,\n startRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n stopRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n pauseRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n resumeRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n prepareRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n}\n\nconst AudioRecorderContext = createContext<UseAudioRecorderState>(initContext)\n\ninterface AudioRecorderProviderProps {\n children: React.ReactNode\n config?: UseAudioRecorderProps\n}\n\nexport const AudioRecorderProvider: React.FC<AudioRecorderProviderProps> = ({\n children,\n config = {},\n}) => {\n const audioRecorder = useAudioRecorder(config)\n return (\n <AudioRecorderContext.Provider value={audioRecorder}>\n {children}\n </AudioRecorderContext.Provider>\n )\n}\n\nexport const useSharedAudioRecorder = () => {\n const context = useContext(AudioRecorderContext)\n if (!context) {\n throw new Error(\n 'useSharedAudioRecorder must be used within an AudioRecorderProvider'\n )\n }\n return context\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// packages/audio-studio/src/AudioRecorder.provider.tsx
|
|
2
|
-
import
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
3
4
|
import { useAudioRecorder } from './useAudioRecorder';
|
|
4
5
|
const initContext = {
|
|
5
6
|
isRecording: false,
|
|
@@ -26,9 +27,7 @@ const initContext = {
|
|
|
26
27
|
const AudioRecorderContext = createContext(initContext);
|
|
27
28
|
export const AudioRecorderProvider = ({ children, config = {}, }) => {
|
|
28
29
|
const audioRecorder = useAudioRecorder(config);
|
|
29
|
-
return (
|
|
30
|
-
{children}
|
|
31
|
-
</AudioRecorderContext.Provider>);
|
|
30
|
+
return (_jsx(AudioRecorderContext.Provider, { value: audioRecorder, children: children }));
|
|
32
31
|
};
|
|
33
32
|
export const useSharedAudioRecorder = () => {
|
|
34
33
|
const context = useContext(AudioRecorderContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioRecorder.provider.js","sourceRoot":"","sources":["../../src/AudioRecorder.provider.tsx"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"AudioRecorder.provider.js","sourceRoot":"","sources":["../../src/AudioRecorder.provider.tsx"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,EAAyB,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,MAAM,WAAW,GAA0B;IACvC,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,aAAa,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,cAAc,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,eAAe,EAAE,KAAK,IAAI,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;IACD,gBAAgB,EAAE,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACtD,CAAC;CACJ,CAAA;AAED,MAAM,oBAAoB,GAAG,aAAa,CAAwB,WAAW,CAAC,CAAA;AAO9E,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EACxE,QAAQ,EACR,MAAM,GAAG,EAAE,GACd,EAAE,EAAE;IACD,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC9C,OAAO,CACH,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAC9C,QAAQ,GACmB,CACnC,CAAA;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IAChD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACX,qEAAqE,CACxE,CAAA;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC,CAAA","sourcesContent":["// packages/audio-studio/src/AudioRecorder.provider.tsx\nimport React, { createContext, useContext } from 'react'\n\nimport { UseAudioRecorderState } from './AudioStudio.types'\nimport { UseAudioRecorderProps, useAudioRecorder } from './useAudioRecorder'\n\nconst initContext: UseAudioRecorderState = {\n isRecording: false,\n isPaused: false,\n durationMs: 0,\n size: 0,\n compression: undefined,\n startRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n stopRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n pauseRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n resumeRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n prepareRecording: async () => {\n throw new Error('AudioRecorderProvider not found')\n },\n}\n\nconst AudioRecorderContext = createContext<UseAudioRecorderState>(initContext)\n\ninterface AudioRecorderProviderProps {\n children: React.ReactNode\n config?: UseAudioRecorderProps\n}\n\nexport const AudioRecorderProvider: React.FC<AudioRecorderProviderProps> = ({\n children,\n config = {},\n}) => {\n const audioRecorder = useAudioRecorder(config)\n return (\n <AudioRecorderContext.Provider value={audioRecorder}>\n {children}\n </AudioRecorderContext.Provider>\n )\n}\n\nexport const useSharedAudioRecorder = () => {\n const context = useContext(AudioRecorderContext)\n if (!context) {\n throw new Error(\n 'useSharedAudioRecorder must be used within an AudioRecorderProvider'\n )\n }\n return context\n}\n"]}
|
package/ios/AudioStudio.podspec
CHANGED
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platforms = { :ios => '
|
|
13
|
+
s.platforms = { :ios => '16.4', :tvos => '16.4' }
|
|
14
14
|
s.swift_version = '5.4'
|
|
15
15
|
s.source = { git: 'https://github.com/deeeed/audiolab' }
|
|
16
16
|
s.static_framework = true
|
package/package.json
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
2
|
+
"name": "@siteed/audio-studio",
|
|
3
|
+
"version": "3.2.1-beta.0",
|
|
4
|
+
"description": "Comprehensive audio processing library for React Native and Expo with recording, analysis, visualization, and streaming capabilities across iOS, Android, and web",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./build/cjs/index.js",
|
|
8
|
+
"module": "./build/esm/index.js",
|
|
9
|
+
"types": "./build/types/index.d.ts",
|
|
10
|
+
"expo": {
|
|
11
|
+
"plugin": "./app.plugin.js"
|
|
12
|
+
},
|
|
13
|
+
"author": "Arthur Breton <abreton@siteed.net> (https://github.com/deeeed)",
|
|
14
|
+
"homepage": "https://github.com/deeeed/audiolab/blob/main/packages/audio-studio/README.md",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/deeeed/audiolab.git",
|
|
18
|
+
"directory": "packages/audio-studio"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/deeeed/audiolab/issues"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"react-native",
|
|
25
|
+
"expo",
|
|
26
|
+
"audio",
|
|
27
|
+
"recording",
|
|
28
|
+
"audio-analysis",
|
|
29
|
+
"audio-processing",
|
|
30
|
+
"audio-visualization",
|
|
31
|
+
"waveform",
|
|
32
|
+
"spectrogram",
|
|
33
|
+
"mel-spectrogram",
|
|
34
|
+
"mfcc",
|
|
35
|
+
"audio-features",
|
|
36
|
+
"audio-compression",
|
|
37
|
+
"opus",
|
|
38
|
+
"aac",
|
|
39
|
+
"pcm",
|
|
40
|
+
"wav",
|
|
41
|
+
"cross-platform",
|
|
42
|
+
"background-recording",
|
|
43
|
+
"audio-trimming",
|
|
44
|
+
"dual-stream"
|
|
45
|
+
],
|
|
46
|
+
"files": [
|
|
47
|
+
"src",
|
|
48
|
+
"android",
|
|
49
|
+
"ios",
|
|
50
|
+
"cpp",
|
|
51
|
+
"plugin",
|
|
52
|
+
"app.plugin.js",
|
|
53
|
+
"LICENSE",
|
|
54
|
+
"CHANGELOG.md",
|
|
55
|
+
"generated",
|
|
56
|
+
"expo-module.config.json",
|
|
57
|
+
"README.md",
|
|
58
|
+
"package.json",
|
|
59
|
+
"*.podspec",
|
|
60
|
+
"prebuilt",
|
|
61
|
+
"build",
|
|
62
|
+
"!ios/build",
|
|
63
|
+
"!android/build",
|
|
64
|
+
"!android/gradle",
|
|
65
|
+
"!android/gradlew",
|
|
66
|
+
"!android/gradlew.bat",
|
|
67
|
+
"!android/local.properties",
|
|
68
|
+
"!ios/AudioStudioTests",
|
|
69
|
+
"!ios/AudioStudioTests/**",
|
|
70
|
+
"!ios/tests",
|
|
71
|
+
"!ios/tests/**",
|
|
72
|
+
"!android/src/androidTest",
|
|
73
|
+
"!android/src/androidTest/**",
|
|
74
|
+
"!android/src/test",
|
|
75
|
+
"!android/src/test/**",
|
|
76
|
+
"!android/src/test/resources",
|
|
77
|
+
"!android/src/test/resources/**",
|
|
78
|
+
"!**/__tests__",
|
|
79
|
+
"!**/__fixtures__",
|
|
80
|
+
"!**/__mocks__",
|
|
81
|
+
"!**/.*"
|
|
82
|
+
],
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build:wasm": "bash scripts/build-wasm.sh",
|
|
85
|
+
"build": "rimraf build && yarn build:types && yarn build:cjs && yarn build:esm && yarn build:plugin && cp -r prebuilt/ build/cjs/prebuilt && cp -r prebuilt/ build/esm/prebuilt",
|
|
86
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
87
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
88
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
89
|
+
"build:plugin": "tsc --project plugin/tsconfig.json && cp plugin/build/index.js plugin/build/index.cjs",
|
|
90
|
+
"build:plugin:dev": "expo-module build plugin",
|
|
91
|
+
"build:dev": "expo-module build",
|
|
92
|
+
"clean": "expo-module clean && rimraf build plugin/build",
|
|
93
|
+
"lint": "expo-module lint",
|
|
94
|
+
"lint:fix": "expo-module lint --fix",
|
|
95
|
+
"test": "expo-module test",
|
|
96
|
+
"test:android": "yarn test:android:unit && yarn test:android:instrumented",
|
|
97
|
+
"test:android:unit": "cd ../../apps/playground/android && ./gradlew :siteed-audio-studio:test",
|
|
98
|
+
"test:android:instrumented": "cd ../../apps/playground/android && ./gradlew :siteed-audio-studio:connectedAndroidTest",
|
|
99
|
+
"test:android:unit:watch": "cd ../../apps/playground/android && ./gradlew :siteed-audio-studio:test --continuous",
|
|
100
|
+
"test:ios": "cd ../../apps/playground/ios && xcodebuild -workspace AudioDevPlayground.xcworkspace -scheme AudioDevPlayground -destination 'generic/platform=iOS Simulator' build",
|
|
101
|
+
"test:coverage": "cd ../../apps/playground/android && ./gradlew :siteed-audio-studio:jacocoTestReport",
|
|
102
|
+
"typecheck": "tsc --noEmit",
|
|
103
|
+
"docgen": "typedoc src/index.ts --plugin typedoc-plugin-markdown --readme none --out ../../documentation_site/docs/api-reference/API && node ../../scripts/escape-mdx-generics.js ../../documentation_site/docs/api-reference",
|
|
104
|
+
"prepare": "yarn build && node -e \"require('fs').renameSync('./plugin/build/index.d.ts', './plugin/build/index.d.cts')\"",
|
|
105
|
+
"prepublishOnly.disabled": "expo-module prepublishOnly",
|
|
106
|
+
"expo-module": "expo-module",
|
|
107
|
+
"open:ios": "open -a \"Xcode\" ../../apps/playground/ios",
|
|
108
|
+
"open:android": "open -a \"Android Studio\" ../../apps/playground/android",
|
|
109
|
+
"size": "bundle-size && size-limit",
|
|
110
|
+
"release": "./publish.sh",
|
|
111
|
+
"agent:test:unit": "yarn test:android:unit",
|
|
112
|
+
"agent:test:integration": "yarn test:android:instrumented",
|
|
113
|
+
"agent:compilation:check": "yarn typecheck && yarn build",
|
|
114
|
+
"android": "cd ../../apps/playground && yarn android",
|
|
115
|
+
"android:launch": "cd ../../apps/playground && yarn android:launch",
|
|
116
|
+
"validate:stream-long": "node scripts/validate-stream-long.mjs",
|
|
117
|
+
"android:device": "cd ../../apps/playground && yarn android:device",
|
|
118
|
+
"android:device:launch": "cd ../../apps/playground && yarn android:device:launch",
|
|
119
|
+
"summarize:stream-long": "node scripts/summarize-stream-long.mjs"
|
|
120
|
+
},
|
|
121
|
+
"devDependencies": {
|
|
122
|
+
"@expo/config-plugins": "~56.0.8",
|
|
123
|
+
"@expo/npm-proofread": "^1.0.1",
|
|
124
|
+
"@siteed/publisher": "^0.4.18",
|
|
125
|
+
"@size-limit/preset-big-lib": "^11.1.4",
|
|
126
|
+
"@types/jest": "^29.5.12",
|
|
127
|
+
"@types/node": "^20.12.7",
|
|
128
|
+
"@types/react": "^19.1.1",
|
|
129
|
+
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
130
|
+
"@typescript-eslint/parser": "^8.60.0",
|
|
131
|
+
"bundle-size": "^1.1.5",
|
|
132
|
+
"eslint": "^8.56.0",
|
|
133
|
+
"eslint-config-prettier": "^9.1.0",
|
|
134
|
+
"eslint-config-universe": "^12.0.0",
|
|
135
|
+
"eslint-plugin-import": "^2.29.1",
|
|
136
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
137
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
138
|
+
"eslint-plugin-react": "^7.34.1",
|
|
139
|
+
"expo": "^56.0.5",
|
|
140
|
+
"expo-module-scripts": "^56.0.2",
|
|
141
|
+
"expo-modules-core": "~56.0.13",
|
|
142
|
+
"jest": "^29.7.0",
|
|
143
|
+
"prettier": "^3.2.5",
|
|
144
|
+
"react": "19.2.3",
|
|
145
|
+
"react-native": "0.85.3",
|
|
146
|
+
"rimraf": "^6.0.1",
|
|
147
|
+
"size-limit": "^11.1.4",
|
|
148
|
+
"ts-jest": "^29.4.11",
|
|
149
|
+
"ts-node": "^10.9.2",
|
|
150
|
+
"typedoc": "^0.28.19",
|
|
151
|
+
"typedoc-plugin-markdown": "~4.11.0",
|
|
152
|
+
"typescript": "~6.0.3"
|
|
153
|
+
},
|
|
154
|
+
"peerDependencies": {
|
|
155
|
+
"@expo/config-plugins": ">=7.0.0",
|
|
156
|
+
"expo": ">=52.0.0",
|
|
157
|
+
"react": "*",
|
|
158
|
+
"react-native": "*"
|
|
159
|
+
},
|
|
160
|
+
"publishConfig": {
|
|
161
|
+
"access": "public",
|
|
162
|
+
"registry": "https://registry.npmjs.org"
|
|
163
|
+
}
|
|
164
|
+
}
|
package/plugin/tsconfig.json
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "build",
|
|
5
5
|
"lib": ["es2023", "dom"],
|
|
6
|
-
"rootDir": "src"
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"types": ["node"]
|
|
8
|
+
},
|
|
9
|
+
"ts-node": {
|
|
10
|
+
"compilerOptions": {
|
|
11
|
+
"rootDir": "."
|
|
12
|
+
}
|
|
7
13
|
},
|
|
8
14
|
"include": ["./src"],
|
|
9
15
|
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
|
|
10
|
-
}
|
|
16
|
+
}
|
package/scripts/README.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Test Scripts
|
|
2
|
-
|
|
3
|
-
This directory contains unified test scripts for expo-audio-studio.
|
|
4
|
-
|
|
5
|
-
## run_tests.sh
|
|
6
|
-
|
|
7
|
-
A unified test runner that can execute tests for both Android and iOS platforms.
|
|
8
|
-
|
|
9
|
-
### Usage
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
./scripts/run_tests.sh [platform] [type]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Parameters
|
|
16
|
-
|
|
17
|
-
- **platform**: Which platform to test
|
|
18
|
-
- `all` (default) - Run tests for both platforms
|
|
19
|
-
- `android` - Run Android tests only
|
|
20
|
-
- `ios` - Run iOS tests only
|
|
21
|
-
|
|
22
|
-
- **type**: Which type of tests to run
|
|
23
|
-
- `all` (default) - Run all test types
|
|
24
|
-
- `unit` - Run unit tests (Android only)
|
|
25
|
-
- `instrumented` - Run instrumented tests (Android only)
|
|
26
|
-
- `standalone` - Run standalone Swift tests (iOS only)
|
|
27
|
-
|
|
28
|
-
### Examples
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# Run all tests for both platforms
|
|
32
|
-
./scripts/run_tests.sh
|
|
33
|
-
|
|
34
|
-
# Run Android tests only
|
|
35
|
-
./scripts/run_tests.sh android
|
|
36
|
-
|
|
37
|
-
# Run Android unit tests only
|
|
38
|
-
./scripts/run_tests.sh android unit
|
|
39
|
-
|
|
40
|
-
# Run iOS tests only
|
|
41
|
-
./scripts/run_tests.sh ios
|
|
42
|
-
|
|
43
|
-
# Run all tests explicitly
|
|
44
|
-
./scripts/run_tests.sh all all
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Requirements
|
|
48
|
-
|
|
49
|
-
- **Android**: Requires Android SDK and a connected device/emulator for instrumented tests
|
|
50
|
-
- **iOS**: Requires Swift compiler (comes with Xcode)
|
|
51
|
-
|
|
52
|
-
### Output
|
|
53
|
-
|
|
54
|
-
The script provides colored output:
|
|
55
|
-
- π§ͺ Test execution progress
|
|
56
|
-
- β
Success messages in green
|
|
57
|
-
- β Failure messages in red
|
|
58
|
-
- Summary of tests passed/failed
|