@siteed/audio-studio 3.1.1 → 3.2.0-beta.1

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 (37) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/android/src/main/java/net/siteed/audiostudio/AudioStreamDecoder.kt +640 -0
  3. package/android/src/main/java/net/siteed/audiostudio/AudioStudioModule.kt +134 -3
  4. package/android/src/main/java/net/siteed/audiostudio/Constants.kt +4 -0
  5. package/build/cjs/errors/AudioStreamError.js +152 -0
  6. package/build/cjs/errors/AudioStreamError.js.map +1 -0
  7. package/build/cjs/errors/AudioStreamError.test.js +61 -0
  8. package/build/cjs/errors/AudioStreamError.test.js.map +1 -0
  9. package/build/cjs/index.js +7 -1
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/streamAudioData.js +467 -0
  12. package/build/cjs/streamAudioData.js.map +1 -0
  13. package/build/esm/errors/AudioStreamError.js +147 -0
  14. package/build/esm/errors/AudioStreamError.js.map +1 -0
  15. package/build/esm/errors/AudioStreamError.test.js +59 -0
  16. package/build/esm/errors/AudioStreamError.test.js.map +1 -0
  17. package/build/esm/index.js +3 -1
  18. package/build/esm/index.js.map +1 -1
  19. package/build/esm/streamAudioData.js +460 -0
  20. package/build/esm/streamAudioData.js.map +1 -0
  21. package/build/types/errors/AudioStreamError.d.ts +25 -0
  22. package/build/types/errors/AudioStreamError.d.ts.map +1 -0
  23. package/build/types/errors/AudioStreamError.test.d.ts +2 -0
  24. package/build/types/errors/AudioStreamError.test.d.ts.map +1 -0
  25. package/build/types/index.d.ts +5 -1
  26. package/build/types/index.d.ts.map +1 -1
  27. package/build/types/streamAudioData.d.ts +114 -0
  28. package/build/types/streamAudioData.d.ts.map +1 -0
  29. package/ios/AudioProcessingHelpers.swift +10 -5
  30. package/ios/AudioStreamDecoder.swift +523 -0
  31. package/ios/AudioStudioModule.swift +147 -3
  32. package/ios/AudioStudioTests/AudioStreamDecoderTests.swift +128 -0
  33. package/package.json +1 -1
  34. package/src/errors/AudioStreamError.test.ts +65 -0
  35. package/src/errors/AudioStreamError.ts +185 -0
  36. package/src/index.ts +24 -0
  37. package/src/streamAudioData.ts +654 -0
@@ -0,0 +1,147 @@
1
+ const RECOVERABLE = [
2
+ 'ERR_AUDIO_STREAM_CANCELLED',
3
+ 'ERR_AUDIO_STREAM_BUSY',
4
+ 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT',
5
+ 'ERR_AUDIO_STREAM_PERMISSION_DENIED',
6
+ ];
7
+ export class AudioStreamError extends Error {
8
+ code;
9
+ recoverable;
10
+ fileUri;
11
+ platform;
12
+ nativeCode;
13
+ nativeMessage;
14
+ constructor(payload) {
15
+ super(payload.message);
16
+ this.name = 'AudioStreamError';
17
+ this.code = payload.code;
18
+ this.recoverable = payload.recoverable;
19
+ this.fileUri = payload.fileUri;
20
+ this.platform = payload.platform;
21
+ this.nativeCode = payload.nativeCode;
22
+ this.nativeMessage = payload.nativeMessage;
23
+ }
24
+ toJSON() {
25
+ return {
26
+ code: this.code,
27
+ message: this.message,
28
+ recoverable: this.recoverable,
29
+ fileUri: this.fileUri,
30
+ platform: this.platform,
31
+ nativeCode: this.nativeCode,
32
+ nativeMessage: this.nativeMessage,
33
+ };
34
+ }
35
+ }
36
+ function getNativeMessage(err) {
37
+ if (err instanceof Error)
38
+ return err.message;
39
+ if (typeof err === 'string')
40
+ return err;
41
+ try {
42
+ return JSON.stringify(err) ?? String(err);
43
+ }
44
+ catch {
45
+ return String(err);
46
+ }
47
+ }
48
+ function getNativeCode(err) {
49
+ if (err && typeof err === 'object' && 'code' in err) {
50
+ const code = err.code;
51
+ if (typeof code === 'string')
52
+ return code;
53
+ }
54
+ return undefined;
55
+ }
56
+ function normalizeCode(raw) {
57
+ if (!raw)
58
+ return null;
59
+ const upper = raw.toUpperCase();
60
+ if (upper.startsWith('ERR_AUDIO_STREAM_')) {
61
+ const known = [
62
+ 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT',
63
+ 'ERR_AUDIO_STREAM_INVALID_RANGE',
64
+ 'ERR_AUDIO_STREAM_DECODE_FAILED',
65
+ 'ERR_AUDIO_STREAM_CANCELLED',
66
+ 'ERR_AUDIO_STREAM_PERMISSION_DENIED',
67
+ 'ERR_AUDIO_STREAM_FILE_NOT_FOUND',
68
+ 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT',
69
+ 'ERR_AUDIO_STREAM_NATIVE_UNAVAILABLE',
70
+ 'ERR_AUDIO_STREAM_BUSY',
71
+ 'ERR_AUDIO_STREAM_UNKNOWN',
72
+ ];
73
+ if (known.includes(upper)) {
74
+ return upper;
75
+ }
76
+ }
77
+ if (upper.includes('FILE_NOT_FOUND') || upper === 'ENOENT') {
78
+ return 'ERR_AUDIO_STREAM_FILE_NOT_FOUND';
79
+ }
80
+ if (upper.includes('PERMISSION') || upper === 'EACCES') {
81
+ return 'ERR_AUDIO_STREAM_PERMISSION_DENIED';
82
+ }
83
+ if (upper.includes('UNSUPPORTED') ||
84
+ upper.includes('NO_SUITABLE_CODEC') ||
85
+ upper.includes('NO SUITABLE CODEC') ||
86
+ upper.includes('NOT SUPPORTED')) {
87
+ return 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT';
88
+ }
89
+ if (upper.includes('INVALID_RANGE') ||
90
+ upper.includes('OUT_OF_RANGE') ||
91
+ upper.includes('INVALID_TIME')) {
92
+ return 'ERR_AUDIO_STREAM_INVALID_RANGE';
93
+ }
94
+ if (upper.includes('CANCELLED') || upper.includes('CANCELED')) {
95
+ return 'ERR_AUDIO_STREAM_CANCELLED';
96
+ }
97
+ if (upper.includes('BUSY')) {
98
+ return 'ERR_AUDIO_STREAM_BUSY';
99
+ }
100
+ if (upper.includes('BACKPRESSURE')) {
101
+ return 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT';
102
+ }
103
+ if (upper.includes('DECODE') ||
104
+ upper.includes('CODEC') ||
105
+ upper.includes('MALFORMED')) {
106
+ return 'ERR_AUDIO_STREAM_DECODE_FAILED';
107
+ }
108
+ return null;
109
+ }
110
+ export function mapStreamError(err, fileUri, platform) {
111
+ if (err instanceof AudioStreamError)
112
+ return err;
113
+ const nativeMessage = getNativeMessage(err);
114
+ const nativeCode = getNativeCode(err);
115
+ const lower = nativeMessage.toLowerCase();
116
+ let code = normalizeCode(nativeCode) ??
117
+ normalizeCode(nativeMessage) ??
118
+ 'ERR_AUDIO_STREAM_UNKNOWN';
119
+ if (code === 'ERR_AUDIO_STREAM_UNKNOWN') {
120
+ if (lower.includes('not found') || lower.includes('does not exist')) {
121
+ code = 'ERR_AUDIO_STREAM_FILE_NOT_FOUND';
122
+ }
123
+ else if (lower.includes('unsupported') ||
124
+ lower.includes('no suitable codec')) {
125
+ code = 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT';
126
+ }
127
+ else if (lower.includes('permission') || lower.includes('denied')) {
128
+ code = 'ERR_AUDIO_STREAM_PERMISSION_DENIED';
129
+ }
130
+ else if (lower.includes('decode') || lower.includes('codec')) {
131
+ code = 'ERR_AUDIO_STREAM_DECODE_FAILED';
132
+ }
133
+ else if (lower.includes('cancel')) {
134
+ code = 'ERR_AUDIO_STREAM_CANCELLED';
135
+ }
136
+ }
137
+ return new AudioStreamError({
138
+ code,
139
+ message: `Audio stream failed (${code}): ${nativeMessage}`,
140
+ recoverable: RECOVERABLE.includes(code),
141
+ fileUri,
142
+ platform,
143
+ nativeCode,
144
+ nativeMessage,
145
+ });
146
+ }
147
+ //# sourceMappingURL=AudioStreamError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioStreamError.js","sourceRoot":"","sources":["../../../src/errors/AudioStreamError.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,GAA2B;IACxC,4BAA4B;IAC5B,uBAAuB;IACvB,uCAAuC;IACvC,oCAAoC;CACvC,CAAA;AAED,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAC9B,IAAI,CAAsB;IAC1B,WAAW,CAAS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Q,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAClE,IAAI,GAAG,iCAAiC,CAAA;QAC5C,CAAC;aAAM,IACH,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC7B,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EACrC,CAAC;YACC,IAAI,GAAG,qCAAqC,CAAA;QAChD,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClE,IAAI,GAAG,oCAAoC,CAAA;QAC/C,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7D,IAAI,GAAG,gCAAgC,CAAA;QAC3C,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,IAAI,GAAG,4BAA4B,CAAA;QACvC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,gBAAgB,CAAC;QACxB,IAAI;QACJ,OAAO,EAAE,wBAAwB,IAAI,MAAM,aAAa,EAAE;QAC1D,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;QACvC,OAAO;QACP,QAAQ;QACR,UAAU;QACV,aAAa;KAChB,CAAC,CAAA;AACN,CAAC","sourcesContent":["/**\n * Stable typed errors for `streamAudioData`. Callers can switch on `code`.\n */\nexport type AudioStreamErrorCode =\n | 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT'\n | 'ERR_AUDIO_STREAM_INVALID_RANGE'\n | 'ERR_AUDIO_STREAM_DECODE_FAILED'\n | 'ERR_AUDIO_STREAM_CANCELLED'\n | 'ERR_AUDIO_STREAM_PERMISSION_DENIED'\n | 'ERR_AUDIO_STREAM_FILE_NOT_FOUND'\n | 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT'\n | 'ERR_AUDIO_STREAM_NATIVE_UNAVAILABLE'\n | 'ERR_AUDIO_STREAM_BUSY'\n | 'ERR_AUDIO_STREAM_UNKNOWN'\n\nexport interface AudioStreamErrorPayload {\n code: AudioStreamErrorCode\n message: string\n recoverable: boolean\n fileUri?: string\n platform?: string\n nativeCode?: string\n nativeMessage?: string\n}\n\nconst RECOVERABLE: AudioStreamErrorCode[] = [\n 'ERR_AUDIO_STREAM_CANCELLED',\n 'ERR_AUDIO_STREAM_BUSY',\n 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT',\n 'ERR_AUDIO_STREAM_PERMISSION_DENIED',\n]\n\nexport class AudioStreamError extends Error {\n readonly code: AudioStreamErrorCode\n readonly recoverable: boolean\n readonly fileUri?: string\n readonly platform?: string\n readonly nativeCode?: string\n readonly nativeMessage?: string\n\n constructor(payload: AudioStreamErrorPayload) {\n super(payload.message)\n this.name = 'AudioStreamError'\n this.code = payload.code\n this.recoverable = payload.recoverable\n this.fileUri = payload.fileUri\n this.platform = payload.platform\n this.nativeCode = payload.nativeCode\n this.nativeMessage = payload.nativeMessage\n }\n\n toJSON(): AudioStreamErrorPayload {\n return {\n code: this.code,\n message: this.message,\n recoverable: this.recoverable,\n fileUri: this.fileUri,\n platform: this.platform,\n nativeCode: this.nativeCode,\n nativeMessage: this.nativeMessage,\n }\n }\n}\n\nfunction getNativeMessage(err: unknown): string {\n if (err instanceof Error) return err.message\n if (typeof err === 'string') return err\n try {\n return JSON.stringify(err) ?? String(err)\n } catch {\n return String(err)\n }\n}\n\nfunction getNativeCode(err: unknown): string | undefined {\n if (err && typeof err === 'object' && 'code' in err) {\n const code = (err as { code?: unknown }).code\n if (typeof code === 'string') return code\n }\n return undefined\n}\n\nfunction normalizeCode(raw: string | undefined): AudioStreamErrorCode | null {\n if (!raw) return null\n const upper = raw.toUpperCase()\n if (upper.startsWith('ERR_AUDIO_STREAM_')) {\n const known: AudioStreamErrorCode[] = [\n 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT',\n 'ERR_AUDIO_STREAM_INVALID_RANGE',\n 'ERR_AUDIO_STREAM_DECODE_FAILED',\n 'ERR_AUDIO_STREAM_CANCELLED',\n 'ERR_AUDIO_STREAM_PERMISSION_DENIED',\n 'ERR_AUDIO_STREAM_FILE_NOT_FOUND',\n 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT',\n 'ERR_AUDIO_STREAM_NATIVE_UNAVAILABLE',\n 'ERR_AUDIO_STREAM_BUSY',\n 'ERR_AUDIO_STREAM_UNKNOWN',\n ]\n if ((known as string[]).includes(upper)) {\n return upper as AudioStreamErrorCode\n }\n }\n if (upper.includes('FILE_NOT_FOUND') || upper === 'ENOENT') {\n return 'ERR_AUDIO_STREAM_FILE_NOT_FOUND'\n }\n if (upper.includes('PERMISSION') || upper === 'EACCES') {\n return 'ERR_AUDIO_STREAM_PERMISSION_DENIED'\n }\n if (\n upper.includes('UNSUPPORTED') ||\n upper.includes('NO_SUITABLE_CODEC') ||\n upper.includes('NO SUITABLE CODEC') ||\n upper.includes('NOT SUPPORTED')\n ) {\n return 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT'\n }\n if (\n upper.includes('INVALID_RANGE') ||\n upper.includes('OUT_OF_RANGE') ||\n upper.includes('INVALID_TIME')\n ) {\n return 'ERR_AUDIO_STREAM_INVALID_RANGE'\n }\n if (upper.includes('CANCELLED') || upper.includes('CANCELED')) {\n return 'ERR_AUDIO_STREAM_CANCELLED'\n }\n if (upper.includes('BUSY')) {\n return 'ERR_AUDIO_STREAM_BUSY'\n }\n if (upper.includes('BACKPRESSURE')) {\n return 'ERR_AUDIO_STREAM_BACKPRESSURE_TIMEOUT'\n }\n if (\n upper.includes('DECODE') ||\n upper.includes('CODEC') ||\n upper.includes('MALFORMED')\n ) {\n return 'ERR_AUDIO_STREAM_DECODE_FAILED'\n }\n return null\n}\n\nexport function mapStreamError(\n err: unknown,\n fileUri?: string,\n platform?: string\n): AudioStreamError {\n if (err instanceof AudioStreamError) return err\n\n const nativeMessage = getNativeMessage(err)\n const nativeCode = getNativeCode(err)\n const lower = nativeMessage.toLowerCase()\n\n let code =\n normalizeCode(nativeCode) ??\n normalizeCode(nativeMessage) ??\n 'ERR_AUDIO_STREAM_UNKNOWN'\n\n if (code === 'ERR_AUDIO_STREAM_UNKNOWN') {\n if (lower.includes('not found') || lower.includes('does not exist')) {\n code = 'ERR_AUDIO_STREAM_FILE_NOT_FOUND'\n } else if (\n lower.includes('unsupported') ||\n lower.includes('no suitable codec')\n ) {\n code = 'ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT'\n } else if (lower.includes('permission') || lower.includes('denied')) {\n code = 'ERR_AUDIO_STREAM_PERMISSION_DENIED'\n } else if (lower.includes('decode') || lower.includes('codec')) {\n code = 'ERR_AUDIO_STREAM_DECODE_FAILED'\n } else if (lower.includes('cancel')) {\n code = 'ERR_AUDIO_STREAM_CANCELLED'\n }\n }\n\n return new AudioStreamError({\n code,\n message: `Audio stream failed (${code}): ${nativeMessage}`,\n recoverable: RECOVERABLE.includes(code),\n fileUri,\n platform,\n nativeCode,\n nativeMessage,\n })\n}\n"]}
@@ -0,0 +1,59 @@
1
+ import { AudioStreamError, mapStreamError } from './AudioStreamError';
2
+ describe('AudioStreamError', () => {
3
+ it('passes through an existing AudioStreamError unchanged', () => {
4
+ const original = new AudioStreamError({
5
+ code: 'ERR_AUDIO_STREAM_CANCELLED',
6
+ message: 'aborted',
7
+ recoverable: true,
8
+ });
9
+ expect(mapStreamError(original)).toBe(original);
10
+ });
11
+ it('maps native FILE_NOT_FOUND code', () => {
12
+ const mapped = mapStreamError({ code: 'FILE_NOT_FOUND', message: 'gone' });
13
+ expect(mapped.code).toBe('ERR_AUDIO_STREAM_FILE_NOT_FOUND');
14
+ expect(mapped.recoverable).toBe(false);
15
+ });
16
+ it('maps unsupported codec text', () => {
17
+ const mapped = mapStreamError(new Error('No suitable codec for audio/opus'));
18
+ expect(mapped.code).toBe('ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT');
19
+ });
20
+ it('marks cancellation as recoverable', () => {
21
+ const mapped = mapStreamError({
22
+ code: 'ERR_AUDIO_STREAM_CANCELLED',
23
+ message: 'user cancelled',
24
+ });
25
+ expect(mapped.code).toBe('ERR_AUDIO_STREAM_CANCELLED');
26
+ expect(mapped.recoverable).toBe(true);
27
+ });
28
+ it('falls back to UNKNOWN', () => {
29
+ const mapped = mapStreamError({});
30
+ expect(mapped.code).toBe('ERR_AUDIO_STREAM_UNKNOWN');
31
+ });
32
+ it('preserves nativeCode and nativeMessage', () => {
33
+ const mapped = mapStreamError({
34
+ code: 'WEIRD_NATIVE_CODE',
35
+ message: 'something went wrong on the bridge',
36
+ });
37
+ expect(mapped.nativeCode).toBe('WEIRD_NATIVE_CODE');
38
+ expect(mapped.nativeMessage).toContain('bridge');
39
+ });
40
+ it('serialises to a stable JSON payload', () => {
41
+ const err = new AudioStreamError({
42
+ code: 'ERR_AUDIO_STREAM_DECODE_FAILED',
43
+ message: 'decoder bust',
44
+ recoverable: false,
45
+ fileUri: 'file:///a.m4a',
46
+ platform: 'ios',
47
+ });
48
+ expect(err.toJSON()).toEqual({
49
+ code: 'ERR_AUDIO_STREAM_DECODE_FAILED',
50
+ message: 'decoder bust',
51
+ recoverable: false,
52
+ fileUri: 'file:///a.m4a',
53
+ platform: 'ios',
54
+ nativeCode: undefined,
55
+ nativeMessage: undefined,
56
+ });
57
+ });
58
+ });
59
+ //# sourceMappingURL=AudioStreamError.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioStreamError.test.js","sourceRoot":"","sources":["../../../src/errors/AudioStreamError.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAErE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC7D,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC;Y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,IAAI,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAC9C,MAAM,MAAM,GAAG,cAAc,CAAC;YAC1B,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,oCAAoC;SAChD,CAAC,CAAA;QACF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACnD,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC3C,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAAC;YAC7B,IAAI,EAAE,gCAAgC;YACtC,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,KAAK;SAClB,CAAC,CAAA;QACF,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;YACzB,IAAI,EAAE,gCAAgC;YACtC,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE,SAAS;SAC3B,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA","sourcesContent":["import { AudioStreamError, mapStreamError } from './AudioStreamError'\n\ndescribe('AudioStreamError', () => {\n it('passes through an existing AudioStreamError unchanged', () => {\n const original = new AudioStreamError({\n code: 'ERR_AUDIO_STREAM_CANCELLED',\n message: 'aborted',\n recoverable: true,\n })\n expect(mapStreamError(original)).toBe(original)\n })\n\n it('maps native FILE_NOT_FOUND code', () => {\n const mapped = mapStreamError({ code: 'FILE_NOT_FOUND', message: 'gone' })\n expect(mapped.code).toBe('ERR_AUDIO_STREAM_FILE_NOT_FOUND')\n expect(mapped.recoverable).toBe(false)\n })\n\n it('maps unsupported codec text', () => {\n const mapped = mapStreamError(new Error('No suitable codec for audio/opus'))\n expect(mapped.code).toBe('ERR_AUDIO_STREAM_UNSUPPORTED_FORMAT')\n })\n\n it('marks cancellation as recoverable', () => {\n const mapped = mapStreamError({\n code: 'ERR_AUDIO_STREAM_CANCELLED',\n message: 'user cancelled',\n })\n expect(mapped.code).toBe('ERR_AUDIO_STREAM_CANCELLED')\n expect(mapped.recoverable).toBe(true)\n })\n\n it('falls back to UNKNOWN', () => {\n const mapped = mapStreamError({})\n expect(mapped.code).toBe('ERR_AUDIO_STREAM_UNKNOWN')\n })\n\n it('preserves nativeCode and nativeMessage', () => {\n const mapped = mapStreamError({\n code: 'WEIRD_NATIVE_CODE',\n message: 'something went wrong on the bridge',\n })\n expect(mapped.nativeCode).toBe('WEIRD_NATIVE_CODE')\n expect(mapped.nativeMessage).toContain('bridge')\n })\n\n it('serialises to a stable JSON payload', () => {\n const err = new AudioStreamError({\n code: 'ERR_AUDIO_STREAM_DECODE_FAILED',\n message: 'decoder bust',\n recoverable: false,\n fileUri: 'file:///a.m4a',\n platform: 'ios',\n })\n expect(err.toJSON()).toEqual({\n code: 'ERR_AUDIO_STREAM_DECODE_FAILED',\n message: 'decoder bust',\n recoverable: false,\n fileUri: 'file:///a.m4a',\n platform: 'ios',\n nativeCode: undefined,\n nativeMessage: undefined,\n })\n })\n})\n"]}
@@ -6,6 +6,7 @@ import { extractPreview } from './AudioAnalysis/extractPreview';
6
6
  import { initMelStreamingWasm, computeMelFrameWasm, } from './AudioAnalysis/melSpectrogramWasm';
7
7
  import { AudioRecorderProvider, useSharedAudioRecorder, } from './AudioRecorder.provider';
8
8
  import AudioStudioModule from './AudioStudioModule';
9
+ import { getAudioDecodeCapabilities, streamAudioData, } from './streamAudioData';
9
10
  import { trimAudio } from './trimAudio';
10
11
  import { useAudioRecorder } from './useAudioRecorder';
11
12
  export * from './utils/convertPCMToFloat32';
@@ -19,8 +20,9 @@ export { AudioDeviceManager, audioDeviceManager } from './AudioDeviceManager';
19
20
  export { useAudioDevices } from './hooks/useAudioDevices';
20
21
  export { setMelSpectrogramWasmUrl } from './AudioAnalysis/wasmConfig';
21
22
  export { extractPreviewBars } from './AudioAnalysis/extractPreviewBars';
22
- export { AudioRecorderProvider, AudioStudioModule, extractRawWavAnalysis, extractAudioAnalysis, extractPreview, trimAudio, extractAudioData, extractMelSpectrogram, initMelStreamingWasm, computeMelFrameWasm, MAX_DURATION_MS, useAudioRecorder, useSharedAudioRecorder, };
23
+ export { AudioRecorderProvider, AudioStudioModule, extractRawWavAnalysis, extractAudioAnalysis, extractPreview, trimAudio, extractAudioData, streamAudioData, getAudioDecodeCapabilities, extractMelSpectrogram, initMelStreamingWasm, computeMelFrameWasm, MAX_DURATION_MS, useAudioRecorder, useSharedAudioRecorder, };
23
24
  export { AudioExtractionError, mapExtractionError, } from './errors/AudioExtractionError';
25
+ export { AudioStreamError, mapStreamError, } from './errors/AudioStreamError';
24
26
  /** @deprecated Use AudioStudioModule instead */
25
27
  export const ExpoAudioStreamModule = AudioStudioModule;
26
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AAEf,OAAO,EACH,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EACH,qBAAqB,EACrB,eAAe,GAClB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EACH,oBAAoB,EACpB,mBAAmB,GACtB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACH,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AAEtC,+BAA+B;AAC/B,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GAE1B,MAAM,iCAAiC,CAAA;AAExC,4BAA4B;AAC5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE7E,8BAA8B;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACH,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,GACzB,CAAA;AAED,OAAO,EACH,oBAAoB,EACpB,kBAAkB,GACrB,MAAM,+BAA+B,CAAA;AAUtC,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAA","sourcesContent":["// src/index.ts\n\nimport {\n extractRawWavAnalysis,\n extractAudioAnalysis,\n} from './AudioAnalysis/extractAudioAnalysis'\nimport { extractAudioData } from './AudioAnalysis/extractAudioData'\nimport {\n extractMelSpectrogram,\n MAX_DURATION_MS,\n} from './AudioAnalysis/extractMelSpectrogram'\nimport { extractPreview } from './AudioAnalysis/extractPreview'\nimport {\n initMelStreamingWasm,\n computeMelFrameWasm,\n} from './AudioAnalysis/melSpectrogramWasm'\nimport {\n AudioRecorderProvider,\n useSharedAudioRecorder,\n} from './AudioRecorder.provider'\nimport AudioStudioModule from './AudioStudioModule'\nimport { trimAudio } from './trimAudio'\nimport { useAudioRecorder } from './useAudioRecorder'\n\nexport * from './utils/convertPCMToFloat32'\nexport * from './utils/getWavFileInfo'\nexport * from './utils/writeWavHeader'\n\n// Export platform capabilities\nexport {\n getPlatformCapabilities,\n isEncodingSupported,\n isBitDepthSupported,\n getFallbackEncoding,\n getFallbackBitDepth,\n validateRecordingConfig,\n type PlatformCapabilities,\n} from './constants/platformLimitations'\n\n// Export AudioDeviceManager\nexport { AudioDeviceManager, audioDeviceManager } from './AudioDeviceManager'\n\n// Export useAudioDevices hook\nexport { useAudioDevices } from './hooks/useAudioDevices'\n\nexport { setMelSpectrogramWasmUrl } from './AudioAnalysis/wasmConfig'\nexport { extractPreviewBars } from './AudioAnalysis/extractPreviewBars'\n\nexport {\n AudioRecorderProvider,\n AudioStudioModule,\n extractRawWavAnalysis,\n extractAudioAnalysis,\n extractPreview,\n trimAudio,\n extractAudioData,\n extractMelSpectrogram,\n initMelStreamingWasm,\n computeMelFrameWasm,\n MAX_DURATION_MS,\n useAudioRecorder,\n useSharedAudioRecorder,\n}\n\nexport {\n AudioExtractionError,\n mapExtractionError,\n} from './errors/AudioExtractionError'\nexport type {\n AudioExtractionErrorCode,\n AudioExtractionErrorPayload,\n} from './errors/AudioExtractionError'\n\n// Export all types\nexport type * from './AudioAnalysis/AudioAnalysis.types'\nexport type * from './AudioStudio.types'\n\n/** @deprecated Use AudioStudioModule instead */\nexport const ExpoAudioStreamModule = AudioStudioModule\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AAEf,OAAO,EACH,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EACH,q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BAAgB,EAChB,cAAc,GACjB,MAAM,2BAA2B,CAAA;AAmBlC,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAA","sourcesContent":["// src/index.ts\n\nimport {\n extractRawWavAnalysis,\n extractAudioAnalysis,\n} from './AudioAnalysis/extractAudioAnalysis'\nimport { extractAudioData } from './AudioAnalysis/extractAudioData'\nimport {\n extractMelSpectrogram,\n MAX_DURATION_MS,\n} from './AudioAnalysis/extractMelSpectrogram'\nimport { extractPreview } from './AudioAnalysis/extractPreview'\nimport {\n initMelStreamingWasm,\n computeMelFrameWasm,\n} from './AudioAnalysis/melSpectrogramWasm'\nimport {\n AudioRecorderProvider,\n useSharedAudioRecorder,\n} from './AudioRecorder.provider'\nimport AudioStudioModule from './AudioStudioModule'\nimport {\n getAudioDecodeCapabilities,\n streamAudioData,\n} from './streamAudioData'\nimport { trimAudio } from './trimAudio'\nimport { useAudioRecorder } from './useAudioRecorder'\n\nexport * from './utils/convertPCMToFloat32'\nexport * from './utils/getWavFileInfo'\nexport * from './utils/writeWavHeader'\n\n// Export platform capabilities\nexport {\n getPlatformCapabilities,\n isEncodingSupported,\n isBitDepthSupported,\n getFallbackEncoding,\n getFallbackBitDepth,\n validateRecordingConfig,\n type PlatformCapabilities,\n} from './constants/platformLimitations'\n\n// Export AudioDeviceManager\nexport { AudioDeviceManager, audioDeviceManager } from './AudioDeviceManager'\n\n// Export useAudioDevices hook\nexport { useAudioDevices } from './hooks/useAudioDevices'\n\nexport { setMelSpectrogramWasmUrl } from './AudioAnalysis/wasmConfig'\nexport { extractPreviewBars } from './AudioAnalysis/extractPreviewBars'\n\nexport {\n AudioRecorderProvider,\n AudioStudioModule,\n extractRawWavAnalysis,\n extractAudioAnalysis,\n extractPreview,\n trimAudio,\n extractAudioData,\n streamAudioData,\n getAudioDecodeCapabilities,\n extractMelSpectrogram,\n initMelStreamingWasm,\n computeMelFrameWasm,\n MAX_DURATION_MS,\n useAudioRecorder,\n useSharedAudioRecorder,\n}\n\nexport {\n AudioExtractionError,\n mapExtractionError,\n} from './errors/AudioExtractionError'\nexport type {\n AudioExtractionErrorCode,\n AudioExtractionErrorPayload,\n} from './errors/AudioExtractionError'\n\nexport {\n AudioStreamError,\n mapStreamError,\n} from './errors/AudioStreamError'\nexport type {\n AudioStreamErrorCode,\n AudioStreamErrorPayload,\n} from './errors/AudioStreamError'\n\nexport type {\n StreamAudioDataOptions,\n StreamAudioDataChunk,\n StreamAudioDataProgress,\n StreamAudioDataResult,\n StreamAudioDataCallbacks,\n AudioDecodeCapabilities,\n} from './streamAudioData'\n\n// Export all types\nexport type * from './AudioAnalysis/AudioAnalysis.types'\nexport type * from './AudioStudio.types'\n\n/** @deprecated Use AudioStudioModule instead */\nexport const ExpoAudioStreamModule = AudioStudioModule\n"]}