react-native-audio-api 0.11.0-alpha.3 → 0.11.0-alpha.5

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 (151) hide show
  1. package/android/src/main/cpp/audioapi/android/core/AndroidAudioRecorder.cpp +34 -6
  2. package/android/src/main/cpp/audioapi/android/core/utils/ffmpegBackend/FFmpegFileWriter.cpp +4 -0
  3. package/android/src/main/cpp/audioapi/android/core/utils/ffmpegBackend/ptrs.hpp +8 -0
  4. package/android/src/main/cpp/audioapi/android/core/utils/ffmpegBackend/utils.cpp +4 -0
  5. package/android/src/main/cpp/audioapi/android/core/utils/miniaudioBackend/MiniAudioFileWriter.h +1 -0
  6. package/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt +164 -16
  7. package/android/src/main/java/com/swmansion/audioapi/core/NativeAudioPlayer.kt +10 -8
  8. package/android/src/main/java/com/swmansion/audioapi/core/NativeAudioRecorder.kt +10 -8
  9. package/android/src/main/java/com/swmansion/audioapi/system/AudioFocusListener.kt +3 -4
  10. package/android/src/main/java/com/swmansion/audioapi/system/CentralizedForegroundService.kt +128 -0
  11. package/android/src/main/java/com/swmansion/audioapi/system/ForegroundServiceManager.kt +116 -0
  12. package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionManager.kt +115 -107
  13. package/android/src/main/java/com/swmansion/audioapi/system/PermissionRequestListener.kt +2 -1
  14. package/android/src/main/java/com/swmansion/audioapi/system/notification/BaseNotification.kt +47 -0
  15. package/android/src/main/java/com/swmansion/audioapi/system/notification/NotificationRegistry.kt +191 -0
  16. package/android/src/main/java/com/swmansion/audioapi/system/notification/PlaybackNotification.kt +669 -0
  17. package/android/src/main/java/com/swmansion/audioapi/system/notification/PlaybackNotificationReceiver.kt +33 -0
  18. package/android/src/main/java/com/swmansion/audioapi/system/notification/RecordingNotification.kt +303 -0
  19. package/android/src/main/java/com/swmansion/audioapi/system/notification/RecordingNotificationReceiver.kt +45 -0
  20. package/android/src/main/java/com/swmansion/audioapi/system/notification/SimpleNotification.kt +119 -0
  21. package/common/cpp/audioapi/core/utils/AudioFileWriter.h +1 -0
  22. package/common/cpp/audioapi/core/utils/AudioRecorderCallback.h +1 -0
  23. package/common/cpp/audioapi/utils/AudioFileProperties.h +17 -17
  24. package/ios/audioapi/ios/AudioAPIModule.h +2 -2
  25. package/ios/audioapi/ios/AudioAPIModule.mm +108 -18
  26. package/ios/audioapi/ios/core/IOSAudioRecorder.mm +8 -7
  27. package/ios/audioapi/ios/core/NativeAudioPlayer.m +1 -1
  28. package/ios/audioapi/ios/core/NativeAudioRecorder.m +9 -2
  29. package/ios/audioapi/ios/system/AudioEngine.h +2 -0
  30. package/ios/audioapi/ios/system/AudioEngine.mm +49 -6
  31. package/ios/audioapi/ios/system/AudioSessionManager.mm +12 -9
  32. package/ios/audioapi/ios/system/NotificationManager.mm +7 -4
  33. package/ios/audioapi/ios/system/notification/BaseNotification.h +58 -0
  34. package/ios/audioapi/ios/system/notification/NotificationRegistry.h +70 -0
  35. package/ios/audioapi/ios/system/notification/NotificationRegistry.mm +172 -0
  36. package/ios/audioapi/ios/system/notification/PlaybackNotification.h +27 -0
  37. package/ios/audioapi/ios/system/notification/PlaybackNotification.mm +427 -0
  38. package/lib/commonjs/api.js +72 -1
  39. package/lib/commonjs/api.js.map +1 -1
  40. package/lib/commonjs/api.web.js +27 -14
  41. package/lib/commonjs/api.web.js.map +1 -1
  42. package/lib/commonjs/specs/NativeAudioAPIModule.js.map +1 -1
  43. package/lib/commonjs/system/AudioManager.js +6 -9
  44. package/lib/commonjs/system/AudioManager.js.map +1 -1
  45. package/lib/commonjs/system/index.js +13 -0
  46. package/lib/commonjs/system/index.js.map +1 -1
  47. package/lib/commonjs/system/notification/PlaybackNotificationManager.js +135 -0
  48. package/lib/commonjs/system/notification/PlaybackNotificationManager.js.map +1 -0
  49. package/lib/commonjs/system/notification/RecordingNotificationManager.js +182 -0
  50. package/lib/commonjs/system/notification/RecordingNotificationManager.js.map +1 -0
  51. package/lib/commonjs/system/notification/SimpleNotificationManager.js +122 -0
  52. package/lib/commonjs/system/notification/SimpleNotificationManager.js.map +1 -0
  53. package/lib/commonjs/system/notification/index.js +45 -0
  54. package/lib/commonjs/system/notification/index.js.map +1 -0
  55. package/lib/commonjs/system/notification/types.js +6 -0
  56. package/lib/commonjs/system/notification/types.js.map +1 -0
  57. package/lib/commonjs/types.js +17 -17
  58. package/lib/commonjs/types.js.map +1 -1
  59. package/lib/commonjs/web-system/index.js +17 -0
  60. package/lib/commonjs/web-system/index.js.map +1 -0
  61. package/lib/commonjs/web-system/notification/PlaybackNotificationManager.js +34 -0
  62. package/lib/commonjs/web-system/notification/PlaybackNotificationManager.js.map +1 -0
  63. package/lib/commonjs/web-system/notification/RecordingNotificationManager.js +34 -0
  64. package/lib/commonjs/web-system/notification/RecordingNotificationManager.js.map +1 -0
  65. package/lib/commonjs/web-system/notification/index.js +21 -0
  66. package/lib/commonjs/web-system/notification/index.js.map +1 -0
  67. package/lib/module/api.js +4 -0
  68. package/lib/module/api.js.map +1 -1
  69. package/lib/module/api.web.js +3 -1
  70. package/lib/module/api.web.js.map +1 -1
  71. package/lib/module/specs/NativeAudioAPIModule.js.map +1 -1
  72. package/lib/module/system/AudioManager.js +6 -9
  73. package/lib/module/system/AudioManager.js.map +1 -1
  74. package/lib/module/system/index.js +1 -0
  75. package/lib/module/system/index.js.map +1 -1
  76. package/lib/module/system/notification/PlaybackNotificationManager.js +131 -0
  77. package/lib/module/system/notification/PlaybackNotificationManager.js.map +1 -0
  78. package/lib/module/system/notification/RecordingNotificationManager.js +178 -0
  79. package/lib/module/system/notification/RecordingNotificationManager.js.map +1 -0
  80. package/lib/module/system/notification/SimpleNotificationManager.js +118 -0
  81. package/lib/module/system/notification/SimpleNotificationManager.js.map +1 -0
  82. package/lib/module/system/notification/index.js +7 -0
  83. package/lib/module/system/notification/index.js.map +1 -0
  84. package/lib/module/system/notification/types.js +4 -0
  85. package/lib/module/system/notification/types.js.map +1 -0
  86. package/lib/module/types.js +17 -17
  87. package/lib/module/types.js.map +1 -1
  88. package/lib/module/web-system/index.js +4 -0
  89. package/lib/module/web-system/index.js.map +1 -0
  90. package/lib/module/web-system/notification/PlaybackNotificationManager.js +30 -0
  91. package/lib/module/web-system/notification/PlaybackNotificationManager.js.map +1 -0
  92. package/lib/module/web-system/notification/RecordingNotificationManager.js +30 -0
  93. package/lib/module/web-system/notification/RecordingNotificationManager.js.map +1 -0
  94. package/lib/module/web-system/notification/index.js +5 -0
  95. package/lib/module/web-system/notification/index.js.map +1 -0
  96. package/lib/typescript/api.d.ts +2 -0
  97. package/lib/typescript/api.d.ts.map +1 -1
  98. package/lib/typescript/api.web.d.ts +3 -1
  99. package/lib/typescript/api.web.d.ts.map +1 -1
  100. package/lib/typescript/events/types.d.ts +3 -3
  101. package/lib/typescript/events/types.d.ts.map +1 -1
  102. package/lib/typescript/specs/NativeAudioAPIModule.d.ts +16 -5
  103. package/lib/typescript/specs/NativeAudioAPIModule.d.ts.map +1 -1
  104. package/lib/typescript/system/AudioManager.d.ts +4 -5
  105. package/lib/typescript/system/AudioManager.d.ts.map +1 -1
  106. package/lib/typescript/system/index.d.ts +1 -0
  107. package/lib/typescript/system/index.d.ts.map +1 -1
  108. package/lib/typescript/system/notification/PlaybackNotificationManager.d.ts +22 -0
  109. package/lib/typescript/system/notification/PlaybackNotificationManager.d.ts.map +1 -0
  110. package/lib/typescript/system/notification/RecordingNotificationManager.d.ts +23 -0
  111. package/lib/typescript/system/notification/RecordingNotificationManager.d.ts.map +1 -0
  112. package/lib/typescript/system/notification/SimpleNotificationManager.d.ts +20 -0
  113. package/lib/typescript/system/notification/SimpleNotificationManager.d.ts.map +1 -0
  114. package/lib/typescript/system/notification/index.d.ts +5 -0
  115. package/lib/typescript/system/notification/index.d.ts.map +1 -0
  116. package/lib/typescript/system/notification/types.d.ts +65 -0
  117. package/lib/typescript/system/notification/types.d.ts.map +1 -0
  118. package/lib/typescript/system/types.d.ts +0 -16
  119. package/lib/typescript/system/types.d.ts.map +1 -1
  120. package/lib/typescript/types.d.ts +16 -16
  121. package/lib/typescript/types.d.ts.map +1 -1
  122. package/lib/typescript/web-system/index.d.ts +2 -0
  123. package/lib/typescript/web-system/index.d.ts.map +1 -0
  124. package/lib/typescript/web-system/notification/PlaybackNotificationManager.d.ts +19 -0
  125. package/lib/typescript/web-system/notification/PlaybackNotificationManager.d.ts.map +1 -0
  126. package/lib/typescript/web-system/notification/RecordingNotificationManager.d.ts +19 -0
  127. package/lib/typescript/web-system/notification/RecordingNotificationManager.d.ts.map +1 -0
  128. package/lib/typescript/web-system/notification/index.d.ts +3 -0
  129. package/lib/typescript/web-system/notification/index.d.ts.map +1 -0
  130. package/package.json +1 -1
  131. package/src/api.ts +17 -0
  132. package/src/api.web.ts +7 -2
  133. package/src/events/types.ts +3 -4
  134. package/src/specs/NativeAudioAPIModule.ts +23 -7
  135. package/src/system/AudioManager.ts +10 -23
  136. package/src/system/index.ts +1 -0
  137. package/src/system/notification/PlaybackNotificationManager.ts +193 -0
  138. package/src/system/notification/RecordingNotificationManager.ts +242 -0
  139. package/src/system/notification/SimpleNotificationManager.ts +170 -0
  140. package/src/system/notification/index.ts +4 -0
  141. package/src/system/notification/types.ts +111 -0
  142. package/src/system/types.ts +0 -18
  143. package/src/types.ts +17 -17
  144. package/src/web-system/index.ts +1 -0
  145. package/src/web-system/notification/PlaybackNotificationManager.ts +60 -0
  146. package/src/web-system/notification/RecordingNotificationManager.ts +60 -0
  147. package/src/web-system/notification/index.ts +2 -0
  148. package/android/src/main/java/com/swmansion/audioapi/system/LockScreenManager.kt +0 -347
  149. package/android/src/main/java/com/swmansion/audioapi/system/MediaNotificationManager.kt +0 -273
  150. package/android/src/main/java/com/swmansion/audioapi/system/MediaReceiver.kt +0 -57
  151. package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionCallback.kt +0 -61
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeAudioAPIModule","AudioEventEmitter","PlaybackNotificationManager","notificationKey","isRegistered","isShown","constructor","audioEventEmitter","global","register","console","warn","Error","result","registerNotification","error","show","info","showNotification","update","updateNotification","hide","hideNotification","unregister","unregisterNotification","enableControl","control","enabled","params","isActive","isNotificationActive","addEventListener","eventName","callback","addAudioEventListener","removeEventListener","subscription","remove"],"sourceRoot":"../../../../src","sources":["system/notification/PlaybackNotificationManager.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,sBAAa;AAClD,SAASC,iBAAiB,QAAgC,uBAAc;AASxE;AACA,MAAMC,2BAA2B,CAOjC;EACUC,eAAe,GAAG,UAAU;EAC5BC,YAAY,GAAG,KAAK;EACpBC,OAAO,GAAG,KAAK;EAGvBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,iBAAiB,GAAG,IAAIN,iBAAiB,CAACO,MAAM,CAACP,iBAAiB,CAAC;EAC1E;;EAEA;EACA,MAAMQ,QAAQA,CAAA,EAAkB;IAC9B,IAAI,IAAI,CAACL,YAAY,EAAE;MACrBM,OAAO,CAACC,IAAI,CAAC,4CAA4C,CAAC;MAC1D;IACF;IAEA,IAAI,CAACX,oBAAoB,EAAE;MACzB,MAAM,IAAIY,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IAEA,MAAMC,MAAM,GAAG,MAAMb,oBAAoB,CAACc,oBAAoB,CAC5D,UAAU,EACV,IAAI,CAACX,eACP,CAAC;IAED,IAAIU,MAAM,CAACE,KAAK,EAAE;MAChB,MAAM,IAAIH,KAAK,CAACC,MAAM,CAACE,KAAK,CAAC;IAC/B;IAEA,IAAI,CAACX,YAAY,GAAG,IAAI;EAC1B;;EAEA;EACA,MAAMY,IAAIA,CAACC,IAA8B,EAAiB;IACxD,IAAI,CAAC,IAAI,CAACb,YAAY,EAAE;MACtB,MAAM,IAAIQ,KAAK,CACb,gFACF,CAAC;IACH;IAEA,IAAI,CAACZ,oBAAoB,EAAE;MACzB,MAAM,IAAIY,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IA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C9DA,YAAY,CAACC,MAAM,CAAC,CAAC;EACvB;AACF;AAEA,eAAe,IAAInC,2BAA2B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+
3
+ import { Platform } from 'react-native';
4
+ import { NativeAudioAPIModule } from "../../specs/index.js";
5
+ import { AudioEventEmitter } from "../../events/index.js";
6
+ /// Manager for recording notifications with controls.
7
+ class RecordingNotificationManager {
8
+ notificationKey = 'recording';
9
+ isRegistered = false;
10
+ isShown = false;
11
+ isIOS = Platform.OS === 'ios';
12
+ constructor() {
13
+ this.audioEventEmitter = new AudioEventEmitter(global.AudioEventEmitter);
14
+ }
15
+
16
+ /// Register the recording notification (must be called before showing).
17
+ async register() {
18
+ if (this.isRegistered) {
19
+ console.warn('RecordingNotification is already registered');
20
+ return;
21
+ }
22
+
23
+ // Recording notifications are only supported on Android
24
+ if (this.isIOS) {
25
+ this.isRegistered = true;
26
+ return;
27
+ }
28
+ if (!NativeAudioAPIModule) {
29
+ throw new Error('NativeAudioAPIModule is not available');
30
+ }
31
+ const result = await NativeAudioAPIModule.registerNotification('recording', this.notificationKey);
32
+ if (result.error) {
33
+ throw new Error(result.error);
34
+ }
35
+ this.isRegistered = true;
36
+ }
37
+
38
+ /// Show the notification with initial metadata.
39
+ async show(info) {
40
+ if (!this.isRegistered) {
41
+ throw new Error('RecordingNotification must be registered before showing. Call register() first.');
42
+ }
43
+
44
+ // Recording notifications are only supported on Android
45
+ if (this.isIOS) {
46
+ this.isShown = true;
47
+ return;
48
+ }
49
+ if (!NativeAudioAPIModule) {
50
+ throw new Error('NativeAudioAPIModule is not available');
51
+ }
52
+ const result = await NativeAudioAPIModule.showNotification(this.notificationKey, info);
53
+ if (result.error) {
54
+ throw new Error(result.error);
55
+ }
56
+ this.isShown = true;
57
+ }
58
+
59
+ /// Update the notification with new metadata or state.
60
+ async update(info) {
61
+ if (!this.isShown) {
62
+ console.warn('RecordingNotification is not shown. Call show() first.');
63
+ return;
64
+ }
65
+
66
+ // Recording notifications are only supported on Android
67
+ if (this.isIOS) {
68
+ return;
69
+ }
70
+ if (!NativeAudioAPIModule) {
71
+ throw new Error('NativeAudioAPIModule is not available');
72
+ }
73
+ const result = await NativeAudioAPIModule.updateNotification(this.notificationKey, info);
74
+ if (result.error) {
75
+ throw new Error(result.error);
76
+ }
77
+ }
78
+
79
+ /// Hide the notification (can be shown again later).
80
+ async hide() {
81
+ if (!this.isShown) {
82
+ return;
83
+ }
84
+
85
+ // Recording notifications are only supported on Android
86
+ if (this.isIOS) {
87
+ this.isShown = false;
88
+ return;
89
+ }
90
+ if (!NativeAudioAPIModule) {
91
+ throw new Error('NativeAudioAPIModule is not available');
92
+ }
93
+ const result = await NativeAudioAPIModule.hideNotification(this.notificationKey);
94
+ if (result.error) {
95
+ throw new Error(result.error);
96
+ }
97
+ this.isShown = false;
98
+ }
99
+
100
+ /// Unregister the notification (must register again to use).
101
+ async unregister() {
102
+ if (!this.isRegistered) {
103
+ return;
104
+ }
105
+ if (this.isShown) {
106
+ await this.hide();
107
+ }
108
+
109
+ // Recording notifications are only supported on Android
110
+ if (this.isIOS) {
111
+ this.isRegistered = false;
112
+ return;
113
+ }
114
+ if (!NativeAudioAPIModule) {
115
+ throw new Error('NativeAudioAPIModule is not available');
116
+ }
117
+ const result = await NativeAudioAPIModule.unregisterNotification(this.notificationKey);
118
+ if (result.error) {
119
+ throw new Error(result.error);
120
+ }
121
+ this.isRegistered = false;
122
+ }
123
+
124
+ /// Enable or disable a specific recording control.
125
+ async enableControl(control, enabled) {
126
+ if (!this.isRegistered) {
127
+ console.warn('RecordingNotification is not registered');
128
+ return;
129
+ }
130
+
131
+ // Recording notifications are only supported on Android
132
+ if (this.isIOS) {
133
+ return;
134
+ }
135
+ if (!NativeAudioAPIModule) {
136
+ throw new Error('NativeAudioAPIModule is not available');
137
+ }
138
+ const params = {
139
+ control,
140
+ enabled
141
+ };
142
+ const result = await NativeAudioAPIModule.updateNotification(this.notificationKey, params);
143
+ if (result.error) {
144
+ throw new Error(result.error);
145
+ }
146
+ }
147
+
148
+ /// Check if the notification is currently active.
149
+ async isActive() {
150
+ // Recording notifications are only supported on Android
151
+ if (this.isIOS) {
152
+ return this.isShown;
153
+ }
154
+ if (!NativeAudioAPIModule) {
155
+ return false;
156
+ }
157
+ return await NativeAudioAPIModule.isNotificationActive(this.notificationKey);
158
+ }
159
+
160
+ /// Add an event listener for notification actions.
161
+ addEventListener(eventName, callback) {
162
+ // Recording notifications are only supported on Android
163
+ if (this.isIOS) {
164
+ // Return a dummy subscription for iOS
165
+ return {
166
+ remove: () => {}
167
+ };
168
+ }
169
+ return this.audioEventEmitter.addAudioEventListener(eventName, callback);
170
+ }
171
+
172
+ /** Remove an event listener. */
173
+ removeEventListener(subscription) {
174
+ subscription.remove();
175
+ }
176
+ }
177
+ export default new RecordingNotificationManager();
178
+ //# sourceMappingURL=RecordingNotificationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","NativeAudioAPIModule","AudioEventEmitter","RecordingNotificationManager","notificationKey","isRegistered","isShown","isIOS","OS","constructor","audioEventEmitter","global","register","console","warn","Error","result","registerNotification","error","show","info","showNotification","update","updateNotification","hide","hideNotification","unregister","unregisterNotification","enableControl","control","enabled","params","isActive","isNotificationActive","addEventListener","eventName","callback","remove","addAudioEventListener","removeEventListener","subscription"],"sourceRoot":"../../../../src","sources":["system/notification/RecordingNotificationManager.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,oBAAoB,QAAQ,sBAAa;AAClD,SAASC,iBAAiB,QAAgC,uBAAc;AASxE;AACA,MAAMC,4BAA4B,CAOlC;EACUC,eAAe,GAAG,WAAW;EAC7BC,YAAY,GAAG,KAAK;EACpBC,OAAO,GAAG,KAAK;EAEfC,KAAK,GAAGP,QAAQ,CAACQ,EAAE,KAAK,KAAK;EAErCC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,iBAAiB,GAAG,IAAIR,iBAAiB,C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AC;IACH;IAEA,OAAO,IAAI,CAAC3B,iBAAiB,CAAC4B,qBAAqB,CAACH,SAAS,EAAEC,QAAQ,CAAC;EAC1E;;EAEA;EACAG,mBAAmBA,CAACC,YAAoC,EAAQ;IAC9DA,YAAY,CAACH,MAAM,CAAC,CAAC;EACvB;AACF;AAEA,eAAe,IAAIlC,4BAA4B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ import { NativeAudioAPIModule } from "../../specs/index.js";
4
+ import { AudioEventEmitter } from "../../events/index.js";
5
+ /// Simple notification manager for basic notifications with title and text.
6
+ /// Implements the generic NotificationManager interface.
7
+ // It is only a showcase
8
+ class SimpleNotificationManager {
9
+ notificationKey = 'simple';
10
+ isRegistered = false;
11
+ isShown = false;
12
+ constructor() {
13
+ this.audioEventEmitter = new AudioEventEmitter(global.AudioEventEmitter);
14
+ }
15
+
16
+ /// Register the simple notification (must be called before showing).
17
+ async register() {
18
+ if (this.isRegistered) {
19
+ console.warn('SimpleNotification is already registered');
20
+ return;
21
+ }
22
+ if (!NativeAudioAPIModule) {
23
+ throw new Error('NativeAudioAPIModule is not available');
24
+ }
25
+ const result = await NativeAudioAPIModule.registerNotification('simple', this.notificationKey);
26
+ if (result.error) {
27
+ throw new Error(result.error);
28
+ }
29
+ this.isRegistered = true;
30
+ }
31
+
32
+ /// Show the notification with initial options.
33
+ async show(options) {
34
+ if (!this.isRegistered) {
35
+ throw new Error('SimpleNotification must be registered before showing. Call register() first.');
36
+ }
37
+ if (!NativeAudioAPIModule) {
38
+ throw new Error('NativeAudioAPIModule is not available');
39
+ }
40
+ const result = await NativeAudioAPIModule.showNotification(this.notificationKey, options);
41
+ if (result.error) {
42
+ throw new Error(result.error);
43
+ }
44
+ this.isShown = true;
45
+ }
46
+
47
+ /// Update the notification with new options.
48
+ async update(options) {
49
+ if (!this.isShown) {
50
+ console.warn('SimpleNotification is not shown. Call show() first.');
51
+ return;
52
+ }
53
+ if (!NativeAudioAPIModule) {
54
+ throw new Error('NativeAudioAPIModule is not available');
55
+ }
56
+ const result = await NativeAudioAPIModule.updateNotification(this.notificationKey, options);
57
+ if (result.error) {
58
+ throw new Error(result.error);
59
+ }
60
+ }
61
+
62
+ /// Hide the notification (can be shown again later).
63
+ async hide() {
64
+ if (!this.isShown) {
65
+ return;
66
+ }
67
+ if (!NativeAudioAPIModule) {
68
+ throw new Error('NativeAudioAPIModule is not available');
69
+ }
70
+ const result = await NativeAudioAPIModule.hideNotification(this.notificationKey);
71
+ if (result.error) {
72
+ throw new Error(result.error);
73
+ }
74
+ this.isShown = false;
75
+ }
76
+
77
+ /// Unregister the notification (must register again to use).
78
+ async unregister() {
79
+ if (!this.isRegistered) {
80
+ return;
81
+ }
82
+ if (this.isShown) {
83
+ await this.hide();
84
+ }
85
+ if (!NativeAudioAPIModule) {
86
+ throw new Error('NativeAudioAPIModule is not available');
87
+ }
88
+ const result = await NativeAudioAPIModule.unregisterNotification(this.notificationKey);
89
+ if (result.error) {
90
+ throw new Error(result.error);
91
+ }
92
+ this.isRegistered = false;
93
+ }
94
+
95
+ /// Check if the notification is currently active.
96
+ async isActive() {
97
+ if (!NativeAudioAPIModule) {
98
+ return false;
99
+ }
100
+ return await NativeAudioAPIModule.isNotificationActive(this.notificationKey);
101
+ }
102
+
103
+ /// Add an event listener (SimpleNotification doesn't emit events).
104
+ addEventListener(_eventName, _callback) {
105
+ // SimpleNotification doesn't emit events, return a no-op subscription
106
+ console.warn('SimpleNotification does not support event listeners');
107
+ return this.audioEventEmitter.addAudioEventListener(
108
+ // Using a valid event name for the no-op subscription
109
+ 'playbackNotificationPlay', () => {});
110
+ }
111
+
112
+ /// Remove an event listener.
113
+ removeEventListener(subscription) {
114
+ subscription.remove();
115
+ }
116
+ }
117
+ export default new SimpleNotificationManager();
118
+ //# sourceMappingURL=SimpleNotificationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeAudioAPIModule","AudioEventEmitter","SimpleNotificationManager","notificationKey","isRegistered","isShown","constructor","audioEventEmitter","global","register","console","warn","Error","result","registerNotification","error","show","options","showNotification","update","updateNotification","hide","hideNotification","unregister","unregisterNotification","isActive","isNotificationActive","addEventListener","_eventName","_callback","addAudioEventListener","removeEventListener","subscription","remove"],"sourceRoot":"../../../../src","sources":["system/notification/SimpleNotificationManager.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,sBAAa;AAClD,SAASC,iBAAiB,QAAgC,uBAAc;AAGxE;AACA;AACA;AACA,MAAMC,yBAAyB,CAO/B;EACUC,eAAe,GAAG,QAAQ;EAC1BC,YAAY,GAAG,KAAK;EACpBC,OAAO,GAAG,KAAK;EAGvBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,iBAAiB,GAAG,IAAIN,iBAAiB,CAACO,MAAM,CAACP,iBAAiB,CAAC;EAC1E;;EAEA;EACA,MAAMQ,QAAQA,CAAA,EAAkB;IAC9B,IAAI,IAAI,CAACL,YAAY,EAAE;MACrBM,OAAO,CAACC,IAAI,CAAC,0CAA0C,CAAC;MACxD;IACF;IAEA,IAAI,CAACX,oBAAoB,EAAE;MACzB,MAAM,IAAIY,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IAEA,MAAMC,MAAM,GAAG,MAAMb,oBAAoB,CAACc,oBAAoB,CAC5D,QAAQ,EACR,IAAI,CAACX,eACP,CAAC;IAED,IAAIU,MAAM,CAACE,KAAK,EAAE;MAChB,MAAM,IAAIH,KAAK,CAACC,MAAM,CAACE,KAAK,CAAC;IAC/B;IAEA,IAAI,CAACX,YAAY,GAAG,IAAI;EAC1B;;EAEA;EACA,MAAMY,IAAIA,CAACC,OAAkC,EAAiB;IAC5D,IAAI,CAAC,IAAI,CAACb,YAAY,EAAE;MACtB,MAAM,IAAIQ,KAAK,CACb,8EACF,CAAC;IACH;IAEA,IAAI,CAACZ,oBAAoB,EAAE;MACzB,MAAM,IAAIY,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IAEA,MAAMC,MAAM,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AAC,CAAC;IACnB;IAEA,IAAI,CAACrB,oBAAoB,EAAE;MACzB,MAAM,IAAIY,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IAEA,MAAMC,MAAM,GAAG,MAAMb,oBAAoB,CAACwB,sBAAsB,CAC9D,IAAI,CAACrB,eACP,CAAC;IAED,IAAIU,MAAM,CAACE,KAAK,EAAE;MAChB,MAAM,IAAIH,KAAK,CAACC,MAAM,CAACE,KAAK,CAAC;IAC/B;IAEA,IAAI,CAACX,YAAY,GAAG,KAAK;EAC3B;;EAEA;EACA,MAAMqB,QAAQA,CAAA,EAAqB;IACjC,IAAI,CAACzB,oBAAoB,EAAE;MACzB,OAAO,KAAK;IACd;IAEA,OAAO,MAAMA,oBAAoB,CAAC0B,oBAAoB,CACpD,IAAI,CAACvB,eACP,CAAC;EACH;;EAEA;EACAwB,gBAAgBA,CACdC,UAAa,EACbC,SAAiC,EACT;IACxB;IACAnB,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;IACnE,OAAO,IAAI,CAACJ,iBAAiB,CAACuB,qBAAqB;IACjD;IACA,0BAA0B,EAC1B,MAAM,CAAC,CACT,CAAC;EACH;;EAEA;EACAC,mBAAmBA,CAACC,YAAoC,EAAQ;IAC9DA,YAAY,CAACC,MAAM,CAAC,CAAC;EACvB;AACF;AAEA,eAAe,IAAI/B,yBAAyB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ export { default as PlaybackNotificationManager } from "./PlaybackNotificationManager.js";
4
+ export { default as RecordingNotificationManager } from "./RecordingNotificationManager.js";
5
+ export { default as SimpleNotificationManager } from "./SimpleNotificationManager.js";
6
+ export * from "./types.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","PlaybackNotificationManager","RecordingNotificationManager","SimpleNotificationManager"],"sourceRoot":"../../../../src","sources":["system/notification/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,2BAA2B,QAAQ,kCAA+B;AACtF,SAASD,OAAO,IAAIE,4BAA4B,QAAQ,mCAAgC;AACxF,SAASF,OAAO,IAAIG,yBAAyB,QAAQ,gCAA6B;AAClF,cAAc,YAAS","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["system/notification/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,25 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  export let FileDirectory = /*#__PURE__*/function (FileDirectory) {
4
- FileDirectory[FileDirectory["Document"] = 1] = "Document";
5
- FileDirectory[FileDirectory["Cache"] = 2] = "Cache";
4
+ FileDirectory[FileDirectory["Document"] = 0] = "Document";
5
+ FileDirectory[FileDirectory["Cache"] = 1] = "Cache";
6
6
  return FileDirectory;
7
7
  }({});
8
8
  export let FileFormat = /*#__PURE__*/function (FileFormat) {
9
- FileFormat[FileFormat["Wav"] = 1] = "Wav";
10
- FileFormat[FileFormat["Caf"] = 2] = "Caf";
11
- FileFormat[FileFormat["M4A"] = 3] = "M4A";
12
- FileFormat[FileFormat["Flac"] = 4] = "Flac";
9
+ FileFormat[FileFormat["Wav"] = 0] = "Wav";
10
+ FileFormat[FileFormat["Caf"] = 1] = "Caf";
11
+ FileFormat[FileFormat["M4A"] = 2] = "M4A";
12
+ FileFormat[FileFormat["Flac"] = 3] = "Flac";
13
13
  return FileFormat;
14
14
  }({});
15
15
  export let IOSAudioQuality = /*#__PURE__*/function (IOSAudioQuality) {
16
- IOSAudioQuality[IOSAudioQuality["Min"] = 1] = "Min";
17
- IOSAudioQuality[IOSAudioQuality["Low"] = 2] = "Low";
18
- IOSAudioQuality[IOSAudioQuality["Medium"] = 3] = "Medium";
19
- IOSAudioQuality[IOSAudioQuality["High"] = 4] = "High";
20
- IOSAudioQuality[IOSAudioQuality["Max"] = 5] = "Max";
16
+ IOSAudioQuality[IOSAudioQuality["Min"] = 0] = "Min";
17
+ IOSAudioQuality[IOSAudioQuality["Low"] = 1] = "Low";
18
+ IOSAudioQuality[IOSAudioQuality["Medium"] = 2] = "Medium";
19
+ IOSAudioQuality[IOSAudioQuality["High"] = 3] = "High";
20
+ IOSAudioQuality[IOSAudioQuality["Max"] = 4] = "Max";
21
21
  return IOSAudioQuality;
22
22
  }({});
23
+ export let BitDepth = /*#__PURE__*/function (BitDepth) {
24
+ BitDepth[BitDepth["Bit16"] = 0] = "Bit16";
25
+ BitDepth[BitDepth["Bit24"] = 1] = "Bit24";
26
+ BitDepth[BitDepth["Bit32"] = 2] = "Bit32";
27
+ return BitDepth;
28
+ }({});
23
29
  export let FlacCompressionLevel = /*#__PURE__*/function (FlacCompressionLevel) {
24
30
  FlacCompressionLevel[FlacCompressionLevel["L0"] = 0] = "L0";
25
31
  FlacCompressionLevel[FlacCompressionLevel["L1"] = 1] = "L1";
@@ -32,10 +38,4 @@ export let FlacCompressionLevel = /*#__PURE__*/function (FlacCompressionLevel) {
32
38
  FlacCompressionLevel[FlacCompressionLevel["L8"] = 8] = "L8";
33
39
  return FlacCompressionLevel;
34
40
  }({});
35
- export let BitDepth = /*#__PURE__*/function (BitDepth) {
36
- BitDepth[BitDepth["Bit16"] = 1] = "Bit16";
37
- BitDepth[BitDepth["Bit24"] = 2] = "Bit24";
38
- BitDepth[BitDepth["Bit32"] = 3] = "Bit32";
39
- return BitDepth;
40
- }({});
41
41
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FileDirectory","FileFormat","IOSAudioQuality","FlacCompressionLevel","BitDepth"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AA6CA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAKzB,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAOtB,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAQ3B,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAYhC,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["FileDirectory","FileFormat","IOSAudioQuality","BitDepth","FlacCompressionLevel"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AA6CA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAKzB,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAOtB,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAQ3B,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAMpB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from "./notification/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["web-system/index.ts"],"mappings":";;AAAA,cAAc,yBAAgB","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable @typescript-eslint/no-unused-vars */
4
+ /* eslint-disable no-useless-constructor */
5
+ /* eslint-disable @typescript-eslint/require-await */
6
+
7
+ /// Mock Manager for playback notifications. Does nothing.
8
+ class PlaybackNotificationManager {
9
+ isRegistered = false;
10
+ isShown = false;
11
+ constructor() {}
12
+ async register() {}
13
+ async show(info) {}
14
+ async update(info) {}
15
+ async hide() {}
16
+ async unregister() {}
17
+ async enableControl(control, enabled) {}
18
+ async isActive() {
19
+ return this.isShown;
20
+ }
21
+ addEventListener(eventName, callback) {
22
+ // dummy subscription object with a no-op remove method
23
+ return {
24
+ remove: () => {}
25
+ };
26
+ }
27
+ removeEventListener(subscription) {}
28
+ }
29
+ export default new PlaybackNotificationManager();
30
+ //# sourceMappingURL=PlaybackNotificationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PlaybackNotificationManager","isRegistered","isShown","constructor","register","show","info","update","hide","unregister","enableControl","control","enabled","isActive","addEventListener","eventName","callback","remove","removeEventListener","subscription"],"sourceRoot":"../../../../src","sources":["web-system/notification/PlaybackNotificationManager.ts"],"mappings":";;AAAA;AACA;AACA;;AAWA;AACA,MAAMA,2BAA2B,CAOjC;EACUC,YAAY,GAAG,KAAK;EACpBC,OAAO,GAAG,KAAK;EAEvBC,WAAWA,CAAA,EAAG,CAAC;EAEf,MAAMC,QAAQA,CAAA,EAAkB,CAAC;EAEjC,MAAMC,IAAIA,CAACC,IAA8B,EAAiB,CAAC;EAE3D,MAAMC,MAAMA,CAACD,IAA8B,EAAiB,CAAC;EAE7D,MAAME,IAAIA,CAAA,EAAkB,CAAC;EAE7B,MAAMC,UAAUA,CAAA,EAAkB,CAAC;EAEnC,MAAMC,aAAaA,CACjBC,OAA4B,EAC5BC,OAAgB,EACD,CAAC;EAElB,MAAMC,QAAQA,CAAA,EAAqB;IACjC,OAAO,IAAI,CAACX,OAAO;EACrB;EAEAY,gBAAgBA,CACdC,SAAY,EACZC,QAAgD,EACxB;IACxB;IACA,OAAO;MACLC,MAAM,EAAEA,CAAA,KAAM,CAAC;IACjB,CAAC;EACH;EAEAC,mBAAmBA,CAACC,YAAoC,EAAQ,CAAC;AACnE;AAEA,eAAe,IAAInB,2BAA2B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable @typescript-eslint/no-unused-vars */
4
+ /* eslint-disable no-useless-constructor */
5
+ /* eslint-disable @typescript-eslint/require-await */
6
+
7
+ /// Mock Manager for recording notifications. Does nothing.
8
+ class RecordingNotificationManager {
9
+ isRegistered = false;
10
+ isShown = false;
11
+ constructor() {}
12
+ async register() {}
13
+ async show(info) {}
14
+ async update(info) {}
15
+ async hide() {}
16
+ async unregister() {}
17
+ async enableControl(control, enabled) {}
18
+ async isActive() {
19
+ return this.isShown;
20
+ }
21
+ addEventListener(eventName, callback) {
22
+ // dummy subscription object with a no-op remove method
23
+ return {
24
+ remove: () => {}
25
+ };
26
+ }
27
+ removeEventListener(subscription) {}
28
+ }
29
+ export default new RecordingNotificationManager();
30
+ //# sourceMappingURL=RecordingNotificationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RecordingNotificationManager","isRegistered","isShown","constructor","register","show","info","update","hide","unregister","enableControl","control","enabled","isActive","addEventListener","eventName","callback","remove","removeEventListener","subscription"],"sourceRoot":"../../../../src","sources":["web-system/notification/RecordingNotificationManager.ts"],"mappings":";;AAAA;AACA;AACA;;AAWA;AACA,MAAMA,4BAA4B,CAOlC;EACUC,YAAY,GAAG,KAAK;EACpBC,OAAO,GAAG,KAAK;EAEvBC,WAAWA,CAAA,EAAG,CAAC;EAEf,MAAMC,QAAQA,CAAA,EAAkB,CAAC;EAEjC,MAAMC,IAAIA,CAACC,IAA+B,EAAiB,CAAC;EAE5D,MAAMC,MAAMA,CAACD,IAA+B,EAAiB,CAAC;EAE9D,MAAME,IAAIA,CAAA,EAAkB,CAAC;EAE7B,MAAMC,UAAUA,CAAA,EAAkB,CAAC;EAEnC,MAAMC,aAAaA,CACjBC,OAA6B,EAC7BC,OAAgB,EACD,CAAC;EAElB,MAAMC,QAAQA,CAAA,EAAqB;IACjC,OAAO,IAAI,CAACX,OAAO;EACrB;EAEAY,gBAAgBA,CACdC,SAAY,EACZC,QAAgD,EACxB;IACxB;IACA,OAAO;MACLC,MAAM,EAAEA,CAAA,KAAM,CAAC;IACjB,CAAC;EACH;EAEAC,mBAAmBA,CAACC,YAAoC,EAAQ,CAAC;AACnE;AAEA,eAAe,IAAInB,4BAA4B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export { default as PlaybackNotificationManager } from "./PlaybackNotificationManager.js";
4
+ export { default as RecordingNotificationManager } from "./RecordingNotificationManager.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","PlaybackNotificationManager","RecordingNotificationManager"],"sourceRoot":"../../../../src","sources":["web-system/notification/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,2BAA2B,QAAQ,kCAA+B;AACtF,SAASD,OAAO,IAAIE,4BAA4B,QAAQ,mCAAgC","ignoreList":[]}
@@ -30,4 +30,6 @@ export * from './errors';
30
30
  export * from './system/types';
31
31
  export * from './types';
32
32
  export { default as FilePreset } from './utils/filePresets';
33
+ export { PlaybackNotificationManager, RecordingNotificationManager, } from './system/notification';
34
+ export { NotificationManager, PlaybackControlName, PlaybackNotificationEventName, PlaybackNotificationInfo, RecordingControlName, RecordingNotificationEventName, RecordingNotificationInfo, SimpleNotificationOptions, } from './system/notification';
33
35
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,SA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,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnD,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,8BAA8B,EAC9B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
@@ -16,6 +16,8 @@ export { default as ConstantSourceNode } from './web-core/ConstantSourceNode';
16
16
  export { default as ConvolverNode } from './web-core/ConvolverNode';
17
17
  export * from './web-core/custom';
18
18
  export { OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation, ContextState, WindowType, PeriodicWaveConstraints, } from './types';
19
- export { IOSCategory, IOSMode, IOSOption, SessionOptions, MediaState, LockScreenInfo, PermissionStatus, } from './system/types';
19
+ export { IOSCategory, IOSMode, IOSOption, SessionOptions, PermissionStatus, } from './system/types';
20
+ export { PlaybackNotificationManager, RecordingNotificationManager, } from './web-system';
21
+ export * from './system/notification/types';
20
22
  export { IndexSizeError, InvalidAccessError, InvalidStateError, RangeError, NotSupportedError, } from './errors';
21
23
  //# sourceMappingURL=api.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.web.d.ts","sourceRoot":"","sources":["../../src/api.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAq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O,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpE,cAAc,mBAAmB,CAAC;AAElC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAEtB,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import AudioBuffer from '../core/AudioBuffer';
2
+ import { NotificationEvents } from '../system';
2
3
  export interface EventEmptyType {
3
4
  }
4
5
  export interface EventTypeWithValue {
@@ -6,7 +7,7 @@ export interface EventTypeWithValue {
6
7
  }
7
8
  interface OnInterruptionEventType {
8
9
  type: 'ended' | 'began';
9
- shouldResume: boolean;
10
+ isTransient: boolean;
10
11
  }
11
12
  interface OnRouteChangeEventType {
12
13
  reason: 'Unknown' | 'Override' | 'CategoryChange' | 'WakeFromSleep' | 'NewDeviceAvailable' | 'OldDeviceUnavailable' | 'ConfigurationChange' | 'NoSuitableRouteForCategory';
@@ -67,8 +68,7 @@ interface AudioAPIEvents {
67
68
  systemStateChanged: EventEmptyType;
68
69
  recorderError: OnRecorderErrorEventType;
69
70
  }
70
- type AudioEvents = SystemEvents & AudioAPIEvents;
71
- export type RemoteCommandEventName = keyof RemoteCommandEvents;
71
+ type AudioEvents = SystemEvents & AudioAPIEvents & NotificationEvents;
72
72
  export type SystemEventName = keyof SystemEvents;
73
73
  export type SystemEventCallback<Name extends SystemEventName> = (event: SystemEvents[Name]) => void;
74
74
  export type AudioAPIEventName = keyof AudioAPIEvents;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/events/types.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,MAAM,WAAW,cAAc;CAAG;AAElC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,MAAM,EACF,SAAS,GACT,UAAU,GACV,gBAAgB,GAChB,eAAe,GACf,oBAAoB,GACpB,sBAAsB,GACtB,qBAAqB,GACrB,4BAA4B,CAAC;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,cAAc,CAAC;IAC3B,qBAAqB,EAAE,cAAc,CAAC;IACtC,wBAAwB,EAAE,kBAAkB,CAAC;IAC7C,eAAe,EAAE,cAAc,CAAC;IAChC,mBAAmB,EAAE,cAAc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AAE,WAAW,CAAC,IAAI,CAAC,KACrB,IAAI,CAAC"}
@@ -1,22 +1,33 @@
1
1
  import type { TurboModule } from 'react-native';
2
2
  import { AudioDevicesInfo, PermissionStatus } from '../system/types';
3
+ type OptionsMap = {
4
+ [key: string]: string | boolean | number | undefined;
5
+ };
6
+ type NotificationOpResponse = {
7
+ success: boolean;
8
+ error?: string;
9
+ };
10
+ type NotificationType = 'playback' | 'recording' | 'simple';
3
11
  interface Spec extends TurboModule {
4
12
  install(): boolean;
5
13
  getDevicePreferredSampleRate(): number;
6
14
  setAudioSessionActivity(enabled: boolean): Promise<boolean>;
7
15
  setAudioSessionOptions(category: string, mode: string, options: Array<string>, allowHaptics: boolean): void;
8
16
  disableSessionManagement(): void;
9
- setLockScreenInfo(info: {
10
- [key: string]: string | boolean | number | undefined;
11
- }): void;
12
- resetLockScreenInfo(): void;
13
- enableRemoteCommand(name: string, enabled: boolean): void;
14
17
  observeAudioInterruptions(enabled: boolean): void;
15
18
  activelyReclaimSession(enabled: boolean): void;
16
19
  observeVolumeChanges(enabled: boolean): void;
17
20
  requestRecordingPermissions(): Promise<PermissionStatus>;
18
21
  checkRecordingPermissions(): Promise<PermissionStatus>;
22
+ requestNotificationPermissions(): Promise<PermissionStatus>;
23
+ checkNotificationPermissions(): Promise<PermissionStatus>;
19
24
  getDevicesInfo(): Promise<AudioDevicesInfo>;
25
+ registerNotification(type: NotificationType, key: string): Promise<NotificationOpResponse>;
26
+ showNotification(key: string, options: OptionsMap): Promise<NotificationOpResponse>;
27
+ updateNotification(key: string, options: OptionsMap): Promise<NotificationOpResponse>;
28
+ hideNotification(key: string): Promise<NotificationOpResponse>;
29
+ unregisterNotification(key: string): Promise<NotificationOpResponse>;
30
+ isNotificationActive(key: string): Promise<boolean>;
20
31
  }
21
32
  declare const NativeAudioAPIModule: Spec | null;
22
33
  export { NativeAudioAPIModule };
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAudioAPIModule.d.ts","sourceRoot":"","sources":["../../../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