@idealyst/audio 1.2.55 → 1.2.56
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/package.json +1 -1
- package/src/index.web.ts +108 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/audio",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.56",
|
|
4
4
|
"description": "Unified cross-platform audio for React and React Native - recording, playback, and PCM streaming",
|
|
5
5
|
"documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/audio#readme",
|
|
6
6
|
"readme": "README.md",
|
package/src/index.web.ts
CHANGED
|
@@ -2,7 +2,113 @@
|
|
|
2
2
|
* @idealyst/audio
|
|
3
3
|
*
|
|
4
4
|
* Unified audio package for recording and playback on web and native.
|
|
5
|
-
*
|
|
5
|
+
* Web implementation using Web Audio API.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Types
|
|
9
|
+
export type {
|
|
10
|
+
// Audio configuration
|
|
11
|
+
SampleRate,
|
|
12
|
+
BitDepth,
|
|
13
|
+
ChannelCount,
|
|
14
|
+
AudioConfig,
|
|
15
|
+
|
|
16
|
+
// Audio session (native)
|
|
17
|
+
AudioSessionCategory,
|
|
18
|
+
AudioSessionCategoryOption,
|
|
19
|
+
AudioSessionMode,
|
|
20
|
+
AudioSessionConfig,
|
|
21
|
+
AudioSessionState,
|
|
22
|
+
AudioSessionInterruption,
|
|
23
|
+
AudioSessionRouteChange,
|
|
24
|
+
|
|
25
|
+
// PCM data
|
|
26
|
+
PCMData,
|
|
27
|
+
AudioLevel,
|
|
28
|
+
|
|
29
|
+
// Recorder
|
|
30
|
+
RecorderState,
|
|
31
|
+
PermissionStatus,
|
|
32
|
+
RecorderStatus,
|
|
33
|
+
RecorderDataCallback,
|
|
34
|
+
RecorderLevelCallback,
|
|
35
|
+
RecorderStateCallback,
|
|
36
|
+
IRecorder,
|
|
37
|
+
|
|
38
|
+
// Player
|
|
39
|
+
PlayerState,
|
|
40
|
+
PlayerStatus,
|
|
41
|
+
PlayerStateCallback,
|
|
42
|
+
PlayerPositionCallback,
|
|
43
|
+
PlayerBufferCallback,
|
|
44
|
+
PlayerEndedCallback,
|
|
45
|
+
IPlayer,
|
|
46
|
+
|
|
47
|
+
// Audio context
|
|
48
|
+
IAudioContext,
|
|
49
|
+
IAudioSessionManager,
|
|
50
|
+
|
|
51
|
+
// Errors
|
|
52
|
+
AudioErrorCode,
|
|
53
|
+
AudioError,
|
|
54
|
+
|
|
55
|
+
// Hook types
|
|
56
|
+
UseAudioOptions,
|
|
57
|
+
UseAudioResult,
|
|
58
|
+
UseRecorderOptions,
|
|
59
|
+
UseRecorderResult,
|
|
60
|
+
UsePlayerOptions,
|
|
61
|
+
UsePlayerResult,
|
|
62
|
+
|
|
63
|
+
// Presets
|
|
64
|
+
AudioProfiles,
|
|
65
|
+
SessionPresets,
|
|
66
|
+
} from './types';
|
|
67
|
+
|
|
68
|
+
// Constants
|
|
69
|
+
export {
|
|
70
|
+
// Audio profiles
|
|
71
|
+
AUDIO_PROFILES,
|
|
72
|
+
|
|
73
|
+
// Session presets
|
|
74
|
+
SESSION_PRESETS,
|
|
75
|
+
|
|
76
|
+
// Defaults
|
|
77
|
+
DEFAULT_AUDIO_CONFIG,
|
|
78
|
+
DEFAULT_AUDIO_LEVEL,
|
|
79
|
+
DEFAULT_RECORDER_STATUS,
|
|
80
|
+
DEFAULT_PLAYER_STATUS,
|
|
81
|
+
DEFAULT_SESSION_STATE,
|
|
82
|
+
DEFAULT_LEVEL_UPDATE_INTERVAL,
|
|
83
|
+
DEFAULT_POSITION_UPDATE_INTERVAL,
|
|
84
|
+
} from './constants';
|
|
85
|
+
|
|
86
|
+
// Context
|
|
87
|
+
export { getAudioContext, WebAudioContextManager } from './context';
|
|
88
|
+
|
|
89
|
+
// Session
|
|
90
|
+
export { getAudioSessionManager, WebAudioSessionManager } from './session';
|
|
91
|
+
|
|
92
|
+
// Recording
|
|
93
|
+
export { createRecorder, WebRecorder } from './recording';
|
|
94
|
+
|
|
95
|
+
// Playback
|
|
96
|
+
export { createPlayer, WebPlayer } from './playback';
|
|
97
|
+
|
|
98
|
+
// Hooks
|
|
99
|
+
export { useAudio, useRecorder, usePlayer } from './hooks';
|
|
100
|
+
|
|
101
|
+
// Utilities
|
|
102
|
+
export {
|
|
103
|
+
createAudioError,
|
|
104
|
+
pcmToFloat32,
|
|
105
|
+
float32ToInt16,
|
|
106
|
+
resampleLinear,
|
|
107
|
+
calculateAudioLevels,
|
|
108
|
+
clamp,
|
|
109
|
+
durationToSamples,
|
|
110
|
+
samplesToDuration,
|
|
111
|
+
createWavHeader,
|
|
112
|
+
arrayBufferToBase64,
|
|
113
|
+
base64ToArrayBuffer,
|
|
114
|
+
} from './utils';
|