@siteed/expo-audio-studio 2.1.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 (188) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/LICENSE +21 -0
  3. package/README.md +269 -0
  4. package/android/build.gradle +105 -0
  5. package/android/src/main/AndroidManifest.xml +27 -0
  6. package/android/src/main/java/net/siteed/audiostream/AudioAnalysisData.kt +166 -0
  7. package/android/src/main/java/net/siteed/audiostream/AudioDataEncoder.kt +9 -0
  8. package/android/src/main/java/net/siteed/audiostream/AudioFileHandler.kt +131 -0
  9. package/android/src/main/java/net/siteed/audiostream/AudioFormatUtils.kt +103 -0
  10. package/android/src/main/java/net/siteed/audiostream/AudioNotificationsManager.kt +435 -0
  11. package/android/src/main/java/net/siteed/audiostream/AudioProcessor.kt +2235 -0
  12. package/android/src/main/java/net/siteed/audiostream/AudioRecorderManager.kt +1437 -0
  13. package/android/src/main/java/net/siteed/audiostream/AudioRecordingService.kt +166 -0
  14. package/android/src/main/java/net/siteed/audiostream/AudioTrimmer.kt +1099 -0
  15. package/android/src/main/java/net/siteed/audiostream/Constants.kt +21 -0
  16. package/android/src/main/java/net/siteed/audiostream/EventSender.kt +7 -0
  17. package/android/src/main/java/net/siteed/audiostream/ExpoAudioStreamModule.kt +739 -0
  18. package/android/src/main/java/net/siteed/audiostream/FFT.kt +99 -0
  19. package/android/src/main/java/net/siteed/audiostream/Features.kt +98 -0
  20. package/android/src/main/java/net/siteed/audiostream/NotificationConfig.kt +70 -0
  21. package/android/src/main/java/net/siteed/audiostream/PermissionUtils.kt +59 -0
  22. package/android/src/main/java/net/siteed/audiostream/RecordingActionReceiver.kt +59 -0
  23. package/android/src/main/java/net/siteed/audiostream/RecordingConfig.kt +205 -0
  24. package/android/src/main/java/net/siteed/audiostream/WaveformConfig.kt +19 -0
  25. package/android/src/main/java/net/siteed/audiostream/WaveformRenderer.kt +159 -0
  26. package/android/src/main/res/drawable/ic_default_action_icon.xml +16 -0
  27. package/android/src/main/res/drawable/ic_microphone.xml +13 -0
  28. package/android/src/main/res/drawable/ic_pause.xml +10 -0
  29. package/android/src/main/res/drawable/ic_play.xml +10 -0
  30. package/android/src/main/res/drawable/ic_stop.xml +10 -0
  31. package/android/src/main/res/layout/notification_recording.xml +37 -0
  32. package/android/src/main/test/java/net/siteed/audiostream/AudioProcessorTest.kt +56 -0
  33. package/app.plugin.js +1 -0
  34. package/build/AudioAnalysis/AudioAnalysis.types.d.ts +179 -0
  35. package/build/AudioAnalysis/AudioAnalysis.types.d.ts.map +1 -0
  36. package/build/AudioAnalysis/AudioAnalysis.types.js +3 -0
  37. package/build/AudioAnalysis/AudioAnalysis.types.js.map +1 -0
  38. package/build/AudioAnalysis/extractAudioAnalysis.d.ts +68 -0
  39. package/build/AudioAnalysis/extractAudioAnalysis.d.ts.map +1 -0
  40. package/build/AudioAnalysis/extractAudioAnalysis.js +203 -0
  41. package/build/AudioAnalysis/extractAudioAnalysis.js.map +1 -0
  42. package/build/AudioAnalysis/extractAudioData.d.ts +3 -0
  43. package/build/AudioAnalysis/extractAudioData.d.ts.map +1 -0
  44. package/build/AudioAnalysis/extractAudioData.js +5 -0
  45. package/build/AudioAnalysis/extractAudioData.js.map +1 -0
  46. package/build/AudioAnalysis/extractMelSpectrogram.d.ts +14 -0
  47. package/build/AudioAnalysis/extractMelSpectrogram.d.ts.map +1 -0
  48. package/build/AudioAnalysis/extractMelSpectrogram.js +85 -0
  49. package/build/AudioAnalysis/extractMelSpectrogram.js.map +1 -0
  50. package/build/AudioAnalysis/extractPreview.d.ts +11 -0
  51. package/build/AudioAnalysis/extractPreview.d.ts.map +1 -0
  52. package/build/AudioAnalysis/extractPreview.js +25 -0
  53. package/build/AudioAnalysis/extractPreview.js.map +1 -0
  54. package/build/AudioAnalysis/extractWaveform.d.ts +8 -0
  55. package/build/AudioAnalysis/extractWaveform.d.ts.map +1 -0
  56. package/build/AudioAnalysis/extractWaveform.js +11 -0
  57. package/build/AudioAnalysis/extractWaveform.js.map +1 -0
  58. package/build/AudioRecorder.provider.d.ts +11 -0
  59. package/build/AudioRecorder.provider.d.ts.map +1 -0
  60. package/build/AudioRecorder.provider.js +37 -0
  61. package/build/AudioRecorder.provider.js.map +1 -0
  62. package/build/ExpoAudioStream.native.d.ts +3 -0
  63. package/build/ExpoAudioStream.native.d.ts.map +1 -0
  64. package/build/ExpoAudioStream.native.js +6 -0
  65. package/build/ExpoAudioStream.native.js.map +1 -0
  66. package/build/ExpoAudioStream.types.d.ts +532 -0
  67. package/build/ExpoAudioStream.types.d.ts.map +1 -0
  68. package/build/ExpoAudioStream.types.js +2 -0
  69. package/build/ExpoAudioStream.types.js.map +1 -0
  70. package/build/ExpoAudioStream.web.d.ts +59 -0
  71. package/build/ExpoAudioStream.web.d.ts.map +1 -0
  72. package/build/ExpoAudioStream.web.js +285 -0
  73. package/build/ExpoAudioStream.web.js.map +1 -0
  74. package/build/ExpoAudioStreamModule.d.ts +3 -0
  75. package/build/ExpoAudioStreamModule.d.ts.map +1 -0
  76. package/build/ExpoAudioStreamModule.js +693 -0
  77. package/build/ExpoAudioStreamModule.js.map +1 -0
  78. package/build/WebRecorder.web.d.ts +119 -0
  79. package/build/WebRecorder.web.d.ts.map +1 -0
  80. package/build/WebRecorder.web.js +436 -0
  81. package/build/WebRecorder.web.js.map +1 -0
  82. package/build/constants.d.ts +11 -0
  83. package/build/constants.d.ts.map +1 -0
  84. package/build/constants.js +14 -0
  85. package/build/constants.js.map +1 -0
  86. package/build/events.d.ts +26 -0
  87. package/build/events.d.ts.map +1 -0
  88. package/build/events.js +21 -0
  89. package/build/events.js.map +1 -0
  90. package/build/index.d.ts +15 -0
  91. package/build/index.d.ts.map +1 -0
  92. package/build/index.js +14 -0
  93. package/build/index.js.map +1 -0
  94. package/build/trimAudio.d.ts +25 -0
  95. package/build/trimAudio.d.ts.map +1 -0
  96. package/build/trimAudio.js +67 -0
  97. package/build/trimAudio.js.map +1 -0
  98. package/build/useAudioRecorder.d.ts +21 -0
  99. package/build/useAudioRecorder.d.ts.map +1 -0
  100. package/build/useAudioRecorder.js +427 -0
  101. package/build/useAudioRecorder.js.map +1 -0
  102. package/build/utils/BlobFix.d.ts +9 -0
  103. package/build/utils/BlobFix.d.ts.map +1 -0
  104. package/build/utils/BlobFix.js +498 -0
  105. package/build/utils/BlobFix.js.map +1 -0
  106. package/build/utils/audioProcessing.d.ts +24 -0
  107. package/build/utils/audioProcessing.d.ts.map +1 -0
  108. package/build/utils/audioProcessing.js +133 -0
  109. package/build/utils/audioProcessing.js.map +1 -0
  110. package/build/utils/concatenateBuffers.d.ts +8 -0
  111. package/build/utils/concatenateBuffers.d.ts.map +1 -0
  112. package/build/utils/concatenateBuffers.js +21 -0
  113. package/build/utils/concatenateBuffers.js.map +1 -0
  114. package/build/utils/convertPCMToFloat32.d.ts +13 -0
  115. package/build/utils/convertPCMToFloat32.d.ts.map +1 -0
  116. package/build/utils/convertPCMToFloat32.js +120 -0
  117. package/build/utils/convertPCMToFloat32.js.map +1 -0
  118. package/build/utils/encodingToBitDepth.d.ts +5 -0
  119. package/build/utils/encodingToBitDepth.d.ts.map +1 -0
  120. package/build/utils/encodingToBitDepth.js +13 -0
  121. package/build/utils/encodingToBitDepth.js.map +1 -0
  122. package/build/utils/getWavFileInfo.d.ts +26 -0
  123. package/build/utils/getWavFileInfo.d.ts.map +1 -0
  124. package/build/utils/getWavFileInfo.js +92 -0
  125. package/build/utils/getWavFileInfo.js.map +1 -0
  126. package/build/utils/writeWavHeader.d.ts +49 -0
  127. package/build/utils/writeWavHeader.d.ts.map +1 -0
  128. package/build/utils/writeWavHeader.js +91 -0
  129. package/build/utils/writeWavHeader.js.map +1 -0
  130. package/build/workers/InlineFeaturesExtractor.web.d.ts +2 -0
  131. package/build/workers/InlineFeaturesExtractor.web.d.ts.map +1 -0
  132. package/build/workers/InlineFeaturesExtractor.web.js +828 -0
  133. package/build/workers/InlineFeaturesExtractor.web.js.map +1 -0
  134. package/build/workers/inlineAudioWebWorker.web.d.ts +2 -0
  135. package/build/workers/inlineAudioWebWorker.web.d.ts.map +1 -0
  136. package/build/workers/inlineAudioWebWorker.web.js +157 -0
  137. package/build/workers/inlineAudioWebWorker.web.js.map +1 -0
  138. package/expo-module.config.json +9 -0
  139. package/ios/AudioAnalysisData.swift +74 -0
  140. package/ios/AudioNotificationManager.swift +135 -0
  141. package/ios/AudioProcessingHelpers.swift +743 -0
  142. package/ios/AudioProcessor.swift +1313 -0
  143. package/ios/AudioStreamError.swift +7 -0
  144. package/ios/AudioStreamManager.swift +1708 -0
  145. package/ios/AudioStreamManagerDelegate.swift +16 -0
  146. package/ios/DataPoint.swift +54 -0
  147. package/ios/DecodingConfig.swift +47 -0
  148. package/ios/ExpoAudioStream.podspec +27 -0
  149. package/ios/ExpoAudioStreamModule.swift +805 -0
  150. package/ios/FFT.swift +62 -0
  151. package/ios/Features.swift +95 -0
  152. package/ios/Logger.swift +7 -0
  153. package/ios/NotificationExtension.swift +15 -0
  154. package/ios/RecordingResult.swift +22 -0
  155. package/ios/RecordingSettings.swift +265 -0
  156. package/ios/WaveformExtractor.swift +105 -0
  157. package/package.json +128 -0
  158. package/plugin/build/index.d.ts +21 -0
  159. package/plugin/build/index.js +192 -0
  160. package/plugin/src/index.ts +279 -0
  161. package/plugin/tsconfig.json +10 -0
  162. package/plugin/tsconfig.tsbuildinfo +1 -0
  163. package/src/AudioAnalysis/AudioAnalysis.types.ts +202 -0
  164. package/src/AudioAnalysis/extractAudioAnalysis.ts +333 -0
  165. package/src/AudioAnalysis/extractAudioData.ts +6 -0
  166. package/src/AudioAnalysis/extractMelSpectrogram.ts +144 -0
  167. package/src/AudioAnalysis/extractPreview.ts +34 -0
  168. package/src/AudioAnalysis/extractWaveform.ts +22 -0
  169. package/src/AudioRecorder.provider.tsx +54 -0
  170. package/src/ExpoAudioStream.native.ts +6 -0
  171. package/src/ExpoAudioStream.types.ts +641 -0
  172. package/src/ExpoAudioStream.web.ts +359 -0
  173. package/src/ExpoAudioStreamModule.ts +967 -0
  174. package/src/WebRecorder.web.ts +580 -0
  175. package/src/constants.ts +18 -0
  176. package/src/events.ts +60 -0
  177. package/src/index.ts +36 -0
  178. package/src/trimAudio.ts +90 -0
  179. package/src/useAudioRecorder.tsx +620 -0
  180. package/src/utils/BlobFix.ts +559 -0
  181. package/src/utils/audioProcessing.ts +205 -0
  182. package/src/utils/concatenateBuffers.ts +24 -0
  183. package/src/utils/convertPCMToFloat32.ts +170 -0
  184. package/src/utils/encodingToBitDepth.ts +18 -0
  185. package/src/utils/getWavFileInfo.ts +132 -0
  186. package/src/utils/writeWavHeader.ts +114 -0
  187. package/src/workers/InlineFeaturesExtractor.web.tsx +827 -0
  188. package/src/workers/inlineAudioWebWorker.web.tsx +156 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,210 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+
11
+ ## [2.1.1] - 2025-03-04
12
+ ### Changed
13
+ - feat: Rename`@siteed/expo-audio-stream` to `@siteed/expo-audio-studio` (#160) ([1b99191](https://github.com/deeeed/expo-audio-stream/commit/1b9919143413a900aefed94c20fc9a8b0e6050d3))
14
+ ## [2.1.0] - 2025-03-04
15
+ ### Changed
16
+ - feat(docs): enhance audio processing documentation and examples (#158) ([26afd49](https://github.com/deeeed/expo-audio-stream/commit/26afd4938e1c626294f40b50a84fe15f5c2bb6a1))
17
+ - feat: Add Mel Spectrogram Extraction and Language Detection to Audio Processing (#157) ([4129dee](https://github.com/deeeed/expo-audio-stream/commit/4129dee87c27dd5a9911c85e3dbf045507876cc1))
18
+ - feat: enhance audio import functionality and decibel visualization (#156) ([2dbecc7](https://github.com/deeeed/expo-audio-stream/commit/2dbecc7bd0ea46edd80c2b0e28dd2a0525953362))
19
+ - feat(trim): Implement iOS trim support with custom filename and format improvements (#152) ([dd49be4](https://github.com/deeeed/expo-audio-stream/commit/dd49be42bccbf3ae6cced8c3662237e1668ec2de))
20
+ - feat: Add Sample Rate Control and Web Trimming Support to Expo Audio Stream (#151) ([9158eec](https://github.com/deeeed/expo-audio-stream/commit/9158eeccc10e25ac77ba3a99185b4dbc5abfb353))
21
+ - feat: Enhance audio trimming with optimized processing and detailed feedback (#150) ([41a6945](https://github.com/deeeed/expo-audio-stream/commit/41a694528d1e803dc0012948eec4edfdc336b4fc))
22
+ - feat(trim): add audio trimming functionality with visualization and preview (Android only) (#149) ([cba03dc](https://github.com/deeeed/expo-audio-stream/commit/cba03dc920eb8a1f111b45e8404a42e48076b7cd))
23
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@2.0.1 ([c77cfc8](https://github.com/deeeed/expo-audio-stream/commit/c77cfc8b70f87a12bb19fa03b245cda7ed2496e1))
24
+ ## [2.0.1] - 2025-02-27
25
+ ### Changed
26
+ - refactor: update background mode handling for audio stream plugin ([e7e98cc](https://github.com/deeeed/expo-audio-stream/commit/e7e98cc60b7965770dcf25e9ae74cb356e1e7097))
27
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@2.0.0 ([356d3f4](https://github.com/deeeed/expo-audio-stream/commit/356d3f40ffb66806eeecb86d12bcbe5d60b7eea6))
28
+ ## [2.0.0] - 2025-02-27
29
+ ### Changed
30
+ - feat(playground): Enhance Audio Playground with Improved UX and Sample Audio Loading (#148) ([09d2794](https://github.com/deeeed/expo-audio-stream/commit/09d27940dcffa60e662c828742f4577bca5327f9))
31
+ - feat: Implement Enhanced Audio Transcription Workflow with Configurable Extraction and UI Updates (#147) ([c658c7e](https://github.com/deeeed/expo-audio-stream/commit/c658c7e8531dd731b01d9347bc7c744470a3b7b9))
32
+ - fix: audio recording reliability improvements and web IndexedDB management (#146) ([d4fa245](https://github.com/deeeed/expo-audio-stream/commit/d4fa245c46d487fe50c6454165efc2e1032ec126))
33
+ - feat(transcription): refactor and unify transcription services across platforms (#145) ([a94b905](https://github.com/deeeed/expo-audio-stream/commit/a94b90562fb2112f712f78c03ca6a5110d6b1401))
34
+ - feat(audio): enhance checksum verification and audio segment analysis (#143) ([49b6587](https://github.com/deeeed/expo-audio-stream/commit/49b65877d1fd9922f25b4892261c4fedf02ba3c3))
35
+ - feat(playground): implement cross-platform ONNX runtime with Silero VAD model (#142) ([4a94639](https://github.com/deeeed/expo-audio-stream/commit/4a9463995f1eadf6531a2b4d6d057e90da097920))
36
+ - feat(audio-analysis): enhance audio analysis and visualization capabilities (#141) ([ecf8f5d](https://github.com/deeeed/expo-audio-stream/commit/ecf8f5daf967bf27afb827c8cf6bca7510ce7b4e))
37
+ - android 15 (#140) ([5321a3c](https://github.com/deeeed/expo-audio-stream/commit/5321a3c805d22e6824fd11fee4290987d550bd06))
38
+ - refactor(audio): consolidate audio analysis APIs and migrate to segment-based processing (#139) ([5d45da8](https://github.com/deeeed/expo-audio-stream/commit/5d45da871ee1849898405ee4bf8bf8d296aebc48))
39
+ - feat: pcm player (#137) ([8db6f16](https://github.com/deeeed/expo-audio-stream/commit/8db6f16f13cbcf78fd4a8e412bb00689e47d5a72))
40
+ - feat(audio-stream): add extractAudioData API ([faf8915](https://github.com/deeeed/expo-audio-stream/commit/faf8915df3b18ea54ca7e562f61749d7cadf8bb4))
41
+ - feat(audio): improve audio trimming and waveform visualization (#136) ([ad5514b](https://github.com/deeeed/expo-audio-stream/commit/ad5514b412eedc7211cb200cc3747e8a83afbf88))
42
+ - feat(audio): enhance audio player with preview, trimming and feature analysis (#135) ([3f7eb9c](https://github.com/deeeed/expo-audio-stream/commit/3f7eb9cde7b314505d8ed3e4704c7b1321da6b15))
43
+ - feat: add web permission for microphone (#131) ([9a2ed7f](https://github.com/deeeed/expo-audio-stream/commit/9a2ed7f31ad41560d094a22d1248034cb2f5886d))
44
+ - refactor(audio): simplify amplitude analysis and remove redundant configuration (#133) ([5d64aa2](https://github.com/deeeed/expo-audio-stream/commit/5d64aa22299836cc9cb925d3e91f3d9470f3e856))
45
+ - feat: add full audio analysis with spectral features and time range controls (#132) ([5677dc3](https://github.com/deeeed/expo-audio-stream/commit/5677dc321f5a9ff4bea37fbbce3cb6ae3aad67f6))
46
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@1.17.0 ([689aead](https://github.com/deeeed/expo-audio-stream/commit/689aeadedaa58050cd18e8ec1fa5ff1fcd93f0db))
47
+ ## [1.17.0] - 2025-02-18
48
+ ### Changed
49
+ - feat(web): add audio interval analysis ([281b7e6](https://github.com/deeeed/expo-audio-stream/commit/281b7e6b1136afe0569450a9d1e3d5f01da7af28))
50
+ - feat(android): implement interval visualization android ([7e9678e](https://github.com/deeeed/expo-audio-stream/commit/7e9678e23b82d8fd3d032fb1d802c925dcff254a))
51
+ - feat(playground): implement intervalAnalysis and validate iOS settings (#126) ([3d35adf](https://github.com/deeeed/expo-audio-stream/commit/3d35adfcc68593c39a72a5e72b7ddf1e6ce6f1fd))
52
+ - feat(ios): Make it possible to set a different interval for the audio analysis (#125) ([10a914e](https://github.com/deeeed/expo-audio-stream/commit/10a914e853deb66f9c3dec1845cab4cfcd34c6da))
53
+ ## [1.16.0] - 2025-02-17
54
+ ### Changed
55
+ - fix(expo-audio-stream): prevent adding iOS background modes when disabled ([5c9d09c](https://github.com/deeeed/expo-audio-stream/commit/5c9d09c715ce008fe72177431224a10f5fd7a865))
56
+ - fix(ios): replace CallKit with AVAudioSession for phone call detection ([e3b664b](https://github.com/deeeed/expo-audio-stream/commit/e3b664ba6925c379b323ded5fc408154e5f092c6))
57
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@1.15.1 ([cbc3d10](https://github.com/deeeed/expo-audio-stream/commit/cbc3d10661a415811f1fe46cb3acaf63451a9df9))
58
+ ## [1.15.1] - 2025-02-17
59
+ ### Changed
60
+ - fix: restore Opus compression support on iOS (#122) ([06614e6](https://github.com/deeeed/expo-audio-stream/commit/06614e6d96fa2a6af56edf0fd2e2b3966e13c8f7))
61
+ - feat: dont block while emitting audio analysis ([01d91d1](https://github.com/deeeed/expo-audio-stream/commit/01d91d1504ccda8ad3569980c79fcf4ae4526a76))
62
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@1.15.0 ([f94c601](https://github.com/deeeed/expo-audio-stream/commit/f94c6016ba4ce968cafbf68644199405f5991d7f))
63
+ ## [1.15.0] - 2025-02-15
64
+ ### Changed
65
+ - fix(ios): improve audio recording interruption handling and auto-resume functionality (#119) ([7767dff](https://github.com/deeeed/expo-audio-stream/commit/7767dff09c7c8d2f2dc8558d24fd2419cb981f4d))
66
+ - fix(android): improve background recording and call interruption handling (#118) ([bf19fe9](https://github.com/deeeed/expo-audio-stream/commit/bf19fe92cadbcc080c27a8aa06ba9a2f6ca841b0))
67
+ ## [1.14.2] - 2025-02-13
68
+ - fix: update STOP action to clear recording metadata ([3484f76](https://github.com/deeeed/expo-audio-stream/commit/3484f76331c0cc83e2384dd18a7f4555f5c5ce8d))
69
+ ## [1.14.1] - 2025-02-12
70
+ - fix: enable background recording by default and improve audio playground (#114) ([2f60d5e](https://github.com/deeeed/expo-audio-stream/commit/2f60d5edd96ea6d0db7cf35614bc12dcd8d9c6ed))
71
+ ## [1.14.0] - 2025-02-12
72
+ - fix: keepAwake issue on ios and auto resume after call (#113) ([ed8e184](https://github.com/deeeed/expo-audio-stream/commit/ed8e184c23ba26973cc9f716e1506d4d7ac4a73d))
73
+ ## [1.13.2] - 2025-02-10
74
+ - fix: ensure foreground service starts within required timeframe ([60dad52](https://github.com/deeeed/expo-audio-stream/commit/60dad5237c11b9a60e6239701317d52c56625d6e))
75
+ ## [1.13.1] - 2025-02-10
76
+ - readme update with latest demos
77
+ ## [1.13.0] - 2025-02-09
78
+ - Audiodecode (#104) ([173f589](https://github.com/deeeed/expo-audio-stream/commit/173f589ebe8763f7361088d150bba1d4bd2c4154))
79
+ - fix: resolve background recording issues and improve status checking (#103) ([a174d50](https://github.com/deeeed/expo-audio-stream/commit/a174d50932b2ee4682f4bd6edb3eaa9a7d579bfc))
80
+ ## [1.12.3] - 2025-02-08
81
+ - fix: infinite rerender issue ([54a6a84](https://github.com/deeeed/expo-audio-stream/commit/54a6a8414688c9fbf897c56503c0091dcaf55e26))
82
+ ## [1.12.1] - 2025-02-01
83
+ - fix: improve audio recording interruption handling and consistency (#98) ([0fd5a146](https://github.com/deeeed/expo-audio-stream/pull/98))
84
+ ## [1.12.0] - 2025-01-31
85
+ - feat: add call state checks before starting or resuming recording (#94) ([63e70a0](https://github.com/deeeed/expo-audio-stream/commit/63e70a09f70dd8e5798094b360cf7ec8de1275e9))
86
+ - feat: add custom filename and directory support for audio recordings (#92) ([2f30f9d](https://github.com/deeeed/expo-audio-stream/commit/2f30f9db2558c456f93f31b79b01cd54a57f392b))
87
+ - feat: enhance compressed recording info with file size (#90) ([47254aa](https://github.com/deeeed/expo-audio-stream/commit/47254aa8cb3ae1c01138ebebce1c1d8c65afd794))
88
+ ## [1.11.3] - 2025-01-25
89
+ - disable duplicate notification alerts for audio stream (#82) ([12f9992](https://github.com/deeeed/expo-audio-stream/commit/12f999247cdd6b08753bcf1b481582a604826383))
90
+ - feat(deps): update expo packages and dependencies to latest patch versions (#81) ([3ed0526](https://github.com/deeeed/expo-audio-stream/commit/3ed0526545623530a10757f1bbd7f877a2c31296))
91
+ ## [1.11.2] - 2025-01-22
92
+ - resources not cleanup properly on app kill (#80) ([7d522a5](https://github.com/deeeed/expo-audio-stream/commit/7d522a531e70065b99758aa3a4c669769fdbd110))
93
+ ## [1.11.1] - 2025-01-22
94
+ - chore: force deployment of 1.11.1
95
+ ## [1.11.0] - 2025-01-22
96
+ - feat(audio): add intelligent call interruption handling & compression improvements ([f8f6187](https://github.com/deeeed/expo-audio-stream/pull/78))
97
+ ## [1.10.0] - 2025-01-14
98
+ - add support for pausing and resuming compressed recordings ([bc3f629](https://github.com/deeeed/expo-audio-stream/commit/bc3f6295d060396325e0f008ff00b3be9c8722cd))
99
+ - optimize notification channel settings ([daa075e](https://github.com/deeeed/expo-audio-stream/commit/daa075e668f8faf0b8d2849e18c37384bdd293b8))
100
+ ## [1.9.2] - 2025-01-12
101
+ - ios bitrate verification to prevent invalid values ([035a180](https://github.com/deeeed/expo-audio-stream/commit/035a1800833264edcc59724aaa8a2e12d5c78dc2))
102
+ ## [1.9.1] - 2025-01-12
103
+ - ios potentially missing compressed file info ([88a628c](https://github.com/deeeed/expo-audio-stream/commit/88a628c35f2bfd626a2a5de1eb6950efd814619d))
104
+ ## [1.9.0] - 2025-01-11
105
+ - feat(web-audio): optimize memory usage and streaming performance for web audio recording (#75) ([7b93e12](https://github.com/deeeed/expo-audio-stream/commit/7b93e12aae4bc0599b06b48ca34a60f65587fc75))
106
+ ## [1.8.0] - 2025-01-10
107
+ - feat(audio): implement audio compression support ([ff4e060](https://github.com/deeeed/expo-audio-stream/commit/ff4e060fef1061804c1cc0126d4344d2d50daa9a))
108
+ ## [1.7.2] - 2025-01-07
109
+ - fix(audio-stream): correct WAV header handling in web audio recording ([9ba7de5](https://github.com/deeeed/expo-audio-stream/commit/9ba7de5b96ca4cc937dea261c80d3fda9c99e8f4))
110
+ ## [1.7.1] - 2025-01-07
111
+ - update notification to avoid triggering new alerts (#71) ([32dcfc5](https://github.com/deeeed/expo-audio-stream/commit/32dcfc55daf3236babefc17016f329c177d466fd))
112
+ ## [1.7.0] - 2025-01-05
113
+ - feat(playground): enhance app configuration and build setup for production deployment (#58) ([929d443](https://github.com/deeeed/expo-audio-stream/commit/929d443145378b1430d215db5c00b13758420e2b))
114
+ - chore(expo-audio-stream): release @siteed/expo-audio-stream@1.6.1 ([084e8ad](https://github.com/deeeed/expo-audio-stream/commit/084e8adb91da7874c9e608b55d9c7b2ffd7a8327))
115
+ - fix(ios): improve audio resampling and duration tracking (#69) ([51bef49](https://github.com/deeeed/expo-audio-stream/commit/51bef493b8e167852c64b8c66a9f8a14cd34f99c))
116
+ - handle paused state in stopRecording (#68) ([15eac9b](https://github.com/deeeed/expo-audio-stream/commit/15eac9bfcc3203e4a5eb5f236286ed72aafde722))
117
+ - reset audio recording state properly on iOS and Android (#66) ([61e9c26](https://github.com/deeeed/expo-audio-stream/commit/61e9c261fb3a979be1894e537233d6e5a4fbdae4))
118
+ - total size doesnt reset on new recording android (#64) ([f7da57b](https://github.com/deeeed/expo-audio-stream/commit/f7da57ba9d6f25870c130c54a049ba4cfad1c444))
119
+ ## [1.6.1] - 2024-12-11
120
+ - chore(expo-audio-stream): remove git commit step from publish script ([4a772ce](https://github.com/deeeed/expo-audio-stream/commit/4a772ce93bb7405d9b8e981f46bdf8941a71ecfe))
121
+ - chore: more publishing automation ([3693021](https://github.com/deeeed/expo-audio-stream/commit/369302107f9dca9dddd8ae68e6214481a39976ac))
122
+ - expo plugin files not published ([b88c446](https://github.com/deeeed/expo-audio-stream/commit/b88c44667013a901fccfe6f89dcb640ae2aae47f))
123
+ - chore(expo-audio-stream): improved build publish script ([ad65a69](https://github.com/deeeed/expo-audio-stream/commit/ad65a69011273e0eab1ac0f464fc3b009fc3433d))
124
+ - fix(expo-audio-stream): missing package files ([0901a1b](https://github.com/deeeed/expo-audio-stream/commit/0901a1bbbcce3111c9b5d61ade8caa48bcdd3613))
125
+ - feat(expo-audio-stream): opt in debug log for plugin config ([03a0a71](https://github.com/deeeed/expo-audio-stream/commit/03a0a7168bb4f77638de51c55a1ad19c713b52dc))
126
+ - fix(expo-audio-stream): include all build + sourcemaps files in the package
127
+ - fix(expo-audio-stream): missing plugin files ([e56254a](https://github.com/deeeed/expo-audio-stream/commit/e56254a4ffa1c015df3d300831ba0b392958b6c8))
128
+ - fix(expo-audio-stream): plugin deployment process and build system enhancements (#56) ([63fbeb8](https://github.com/deeeed/expo-audio-stream/commit/63fbeb82f56130dedeafa633e916f2ce0f8f1a67))
129
+ ## [1.5.0] - 2024-12-10
130
+ - UNPUBLISHED because of a bug in the build system
131
+ ## [1.4.0] - 2024-12-05
132
+ - chore: remove unusded dependencies ([ad81dd5](https://github.com/deeeed/expo-audio-stream/commit/ad81dd560c93dd1d04995a323a4ae72d4de20f3e))
133
+ ## [1.3.1] - 2024-12-05
134
+ - feat(web): implement throttling and optimize event processing (#49) ([da28765](https://github.com/deeeed/expo-audio-stream/commit/da2876524c2c9d6e0a980fde40a0197b929d8a7f))
135
+ ## [1.3.0] - 2024-11-28
136
+ ### Added
137
+ - refactor(permissions): standardize permission status response structure across platforms (#44) ([7c9c800](https://github.com/deeeed/expo-audio-stream/commit/7c9c800d83b7cea3516643371484d5e1f3b99e4c))
138
+ - fix(web): add temporary worklet initialization patch for reanimated ([2afcf02](https://github.com/deeeed/expo-audio-stream/commit/2afcf02ddc982e18a419f0132bc42200f3fdebb1))
139
+ - feat: update expo-modules-core ([54ed5c5](https://github.com/deeeed/expo-audio-stream/commit/54ed5c59affa46fdf8cdc2e8048766247a4ed16c))
140
+ - feat: latest expo fixes ([9cc5ac3](https://github.com/deeeed/expo-audio-stream/commit/9cc5ac39751999e5b33e11c16355557143d68d10))
141
+ - feat: latest expo sdk ([258ef6c](https://github.com/deeeed/expo-audio-stream/commit/258ef6cf68e70c7855f696a01204f79b0793fdc0))
142
+ ## [1.2.5] - 2024-11-12
143
+ ### Added
144
+ - docs(license): add MIT license to all packages (6 files changed)
145
+ - fix(expo-audio-stream): return actual recording settings from startRecording on iOS #37
146
+ ## [1.2.4] - 2024-11-05
147
+ ### Changed
148
+ - Android minimum audio interval set to 10ms.
149
+ - plugin setup do not include 'notification' config by default to prevent ios version mismatch.
150
+
151
+ ### Fixed
152
+ - Remove frequently firing log statements on web.
153
+ ## [1.2.0] - 2024-10-24
154
+ ### Added
155
+ - Feature: `keepAwake` Continue recording when app is in background (default is true)
156
+ - Feature: Customizable recording notifications for Android and iOS
157
+ - Android: Rich notification support with live waveform visualization
158
+ - Android: Configurable notification actions, colors, and priorities
159
+ - iOS: Integration with media player
160
+ ## [1.1.17] - 2024-10-21
161
+ ### Added
162
+ - Support bluetooth headset on ios
163
+ - Fixes: android not reading custom interval audio update
164
+ ## [1.0.0] - 2024-04-01
165
+ ### Added
166
+ - Initial release of @siteed/expo-audio-stream.
167
+ - Feature: Real-time audio streaming across iOS, Android, and web.
168
+ - Feature: Configurable intervals for audio buffer receipt.
169
+ - Feature: Automated microphone permissions setup in managed Expo projects.
170
+ - Feature: Background audio recording on iOS.
171
+ - Feature: Audio features extraction during recording.
172
+ - Feature: Consistent WAV PCM recording format across all platforms.
173
+
174
+ [unreleased]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-studio@2.1.1...HEAD
175
+ [2.1.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-studio@2.1.0...@siteed/expo-audio-studio@2.1.1
176
+ [2.1.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@2.0.1...@siteed/expo-audio-stream@2.1.0
177
+ [2.0.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@2.0.0...@siteed/expo-audio-stream@2.0.1
178
+ [2.0.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.17.0...@siteed/expo-audio-stream@2.0.0
179
+ [1.17.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.16.0...@siteed/expo-audio-stream@1.17.0
180
+ [1.16.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.15.1...@siteed/expo-audio-stream@1.16.0
181
+ [1.15.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.15.0...@siteed/expo-audio-stream@1.15.1
182
+ [1.15.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.14.2...@siteed/expo-audio-stream@1.15.0
183
+ [1.14.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.14.1...@siteed/expo-audio-stream@1.14.2
184
+ [1.14.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.14.0...@siteed/expo-audio-stream@1.14.1
185
+ [1.14.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.13.2...@siteed/expo-audio-stream@1.14.0
186
+ [1.13.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.13.1...@siteed/expo-audio-stream@1.13.2
187
+ [1.13.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.13.0...@siteed/expo-audio-stream@1.13.1
188
+ [1.13.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.12.3...@siteed/expo-audio-stream@1.13.0
189
+ [1.12.3]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.12.2...@siteed/expo-audio-stream@1.12.3
190
+ [1.12.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.12.1...@siteed/expo-audio-stream@1.12.2
191
+ [1.12.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.12.0...@siteed/expo-audio-stream@1.12.1
192
+ [1.12.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.11.6...@siteed/expo-audio-stream@1.12.0
193
+ [1.11.3]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.11.2...@siteed/expo-audio-stream@1.11.3
194
+ [1.11.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.11.1...@siteed/expo-audio-stream@1.11.2
195
+ [1.11.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.11.0...@siteed/expo-audio-stream@1.11.1
196
+ [1.11.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.10.0...@siteed/expo-audio-stream@1.11.0
197
+ [1.10.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.9.2...@siteed/expo-audio-stream@1.10.0
198
+ [1.9.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.9.1...@siteed/expo-audio-stream@1.9.2
199
+ [1.9.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.9.0...@siteed/expo-audio-stream@1.9.1
200
+ [1.9.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.8.0...@siteed/expo-audio-stream@1.9.0
201
+ [1.8.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.7.2...@siteed/expo-audio-stream@1.8.0
202
+ [1.7.2]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.7.1...@siteed/expo-audio-stream@1.7.2
203
+ [1.7.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.7.0...@siteed/expo-audio-stream@1.7.1
204
+ [1.7.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.6.1...@siteed/expo-audio-stream@1.7.0
205
+ [1.6.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.6.0...@siteed/expo-audio-stream@1.6.1
206
+ [1.5.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.4.0...@siteed/expo-audio-stream@1.5.0
207
+ [1.4.0]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.3.1...@siteed/expo-audio-stream@1.4.0
208
+ [1.3.1]: https://github.com/deeeed/expo-audio-stream/compare/@siteed/expo-audio-stream@1.3.0...@siteed/expo-audio-stream@1.3.1
209
+ [Unreleased]: https://github.com/deeeed/expo-audio-stream/compare/v1.0.0...HEAD
210
+ [1.0.0]: https://github.com/deeeed/expo-audio-stream/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Arthur Breton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # @siteed/expo-audio-studio
2
+
3
+ [![kandi X-Ray](https://kandi.openweaver.com/badges/xray.svg)](https://kandi.openweaver.com/typescript/siteed/expo-audio-studio)
4
+ [![Version](https://img.shields.io/npm/v/@siteed/expo-audio-studio.svg)](https://www.npmjs.com/package/@siteed/expo-audio-studio)
5
+ [![Dependency Status](https://img.shields.io/npm/dt/@siteed/expo-audio-studio.svg)](https://www.npmjs.com/package/@siteed/expo-audio-studio)
6
+ [![License](https://img.shields.io/npm/l/@siteed/expo-audio-studio.svg)](https://www.npmjs.com/package/@siteed/expo-audio-studio)
7
+
8
+ <div align="center">
9
+ <p align="center">
10
+ <strong>Comprehensive audio studio library for React Native and Expo with recording, analysis, visualization, and streaming capabilities across iOS, Android, and web platforms.</strong>
11
+ </p>
12
+
13
+ <div style="display: flex; justify-content: center; gap: 20px; margin: 30px 0;">
14
+ <div>
15
+ <h3>iOS Demo</h3>
16
+ <img src="../../docs/ios.gif" alt="iOS Demo" width="280" />
17
+ </div>
18
+ <div>
19
+ <h3>Android Demo</h3>
20
+ <img src="../../docs/android.gif" alt="Android Demo" width="280" />
21
+ </div>
22
+ </div>
23
+
24
+ <a href="https://deeeed.github.io/expo-audio-stream/playground" style="text-decoration:none;">
25
+ <div style="display:inline-block; padding:10px 20px; background-color:#007bff; color:white; border-radius:5px; font-size:16px;">
26
+ Try it in the Playground
27
+ </div>
28
+ </a>
29
+ </div>
30
+
31
+ **Give it a GitHub star 🌟, if you found this repo useful.**
32
+ [![GitHub stars](https://img.shields.io/github/stars/deeeed/expo-audio-stream.svg?style=social&label=Star&maxAge=2592000)](https://github.com/deeeed/expo-audio-stream)
33
+
34
+ > **Note:** This package was formerly known as `@siteed/expo-audio-stream`. The name has been changed to better reflect the expanded capabilities beyond just audio streaming.
35
+
36
+ ## Features
37
+
38
+ - Real-time audio streaming across iOS, Android, and web.
39
+ - Dual-stream recording capabilities:
40
+ - Simultaneous raw PCM and compressed audio recording
41
+ - Compression formats: OPUS or AAC
42
+ - Configurable bitrate for compressed audio
43
+ - Optimized storage for both high-quality and compressed formats
44
+ - Intelligent interruption handling:
45
+ - Automatic pause/resume during phone calls
46
+ - Configurable automatic resumption
47
+ - Detailed interruption event callbacks
48
+ - Configurable intervals for audio buffer receipt.
49
+ - Automated microphone permissions setup in managed Expo projects.
50
+ - Background audio recording on iOS.
51
+ - Audio features extraction during recording.
52
+ - Consistent WAV PCM recording format across all platforms.
53
+ - Keep recording active while app is in background
54
+ - Rich notification system for recording status:
55
+ - Android: Live waveform visualization in notifications
56
+ - Android: Fully customizable notification appearance and actions
57
+ - iOS: Media player integration
58
+ - Advanced audio analysis capabilities:
59
+ - Mel spectrogram generation for machine learning and visualization
60
+ - Comprehensive audio feature extraction (MFCC, spectral features, etc.)
61
+ - Lightweight waveform preview generation
62
+ - Precision audio manipulation:
63
+ - Advanced audio splitting and trimming API
64
+ - Support for trimming multiple segments in a single operation
65
+ - Ability to keep or remove specific time ranges
66
+ - Complete ecosystem:
67
+ - Full-featured AudioPlayground application showcasing advanced API usage
68
+ - Ready-to-use UI components via [@siteed/expo-audio-ui](https://github.com/deeeed/expo-audio-stream/tree/main/packages/expo-audio-ui) package
69
+ - Visualizations, waveforms, and audio controls that can be directly incorporated into your app
70
+
71
+ ## Audio Analysis Features
72
+
73
+ Extract powerful audio features for advanced audio processing and visualization:
74
+
75
+ ```typescript
76
+ // Extract audio analysis with specific features enabled
77
+ const analysis = await extractAudioAnalysis({
78
+ fileUri: 'path/to/recording.wav',
79
+ features: {
80
+ energy: true, // Overall energy of the audio
81
+ rms: true, // Root mean square (amplitude)
82
+ zcr: true, // Zero-crossing rate
83
+ mfcc: true, // Mel-frequency cepstral coefficients
84
+ spectralCentroid: true, // Brightness of sound
85
+ tempo: true, // Estimated BPM
86
+ }
87
+ });
88
+ ```
89
+
90
+ ### Available Audio Features
91
+
92
+ - **Basic Analysis**: RMS, energy, amplitude range, zero-crossing rate
93
+ - **Spectral Features**: Spectral centroid, flatness, rolloff, bandwidth
94
+ - **Advanced Analysis**:
95
+ - MFCC (Mel-frequency cepstral coefficients)
96
+ - Chromagram (pitch class representation)
97
+ - Mel Spectrogram
98
+ - Harmonics-to-noise ratio
99
+ - Tempo estimation
100
+ - Pitch detection
101
+
102
+ ### Use Cases
103
+
104
+ - Visualize audio waveforms with detailed metrics
105
+ - Implement speech recognition preprocessing
106
+ - Create music analysis applications
107
+ - Build audio fingerprinting systems
108
+ - Develop voice activity detection
109
+
110
+ ## API Overview
111
+
112
+ The library provides several specialized APIs for different audio processing needs:
113
+
114
+ ### Recording and Playback
115
+
116
+ - **useAudioRecorder**: Hook for recording audio with configurable quality settings
117
+ - **AudioRecorderProvider**: Context provider for sharing recording state across components
118
+ - **useSharedAudioRecorder**: Hook to access shared recording state from any component
119
+
120
+ ```typescript
121
+ // Start a new recording with configuration
122
+ const { startRecording, stopRecording, isRecording, recordingUri } = useAudioRecorder({
123
+ audioQuality: 'high',
124
+ sampleRate: 44100,
125
+ numberOfChannels: 2,
126
+ bitDepth: 16,
127
+ outputFormat: 'wav',
128
+ });
129
+
130
+ // Share recording state across components
131
+ const AudioApp = () => (
132
+ <AudioRecorderProvider>
133
+ <RecordButton />
134
+ <AudioVisualizer />
135
+ </AudioRecorderProvider>
136
+ );
137
+ ```
138
+
139
+ ### Audio Analysis
140
+
141
+ - **extractAudioAnalysis**: Extract comprehensive audio features for detailed analysis
142
+ - **extractPreview**: Generate lightweight waveform data for visualization
143
+ - **extractAudioData**: Extract raw PCM data for custom processing
144
+ - **extractRawWavAnalysis**: Analyze WAV files without decoding, preserving original PCM values
145
+
146
+ ```typescript
147
+ // Extract detailed audio analysis with feature extraction
148
+ const analysis = await extractAudioAnalysis({
149
+ fileUri: 'path/to/recording.wav',
150
+ features: { rms: true, zcr: true, mfcc: true }
151
+ });
152
+
153
+ // Generate a lightweight waveform preview
154
+ const preview = await extractPreview({
155
+ fileUri: 'path/to/recording.wav',
156
+ pointsPerSecond: 50
157
+ });
158
+
159
+ // Extract raw PCM data for custom processing
160
+ const audioData = await extractAudioData({
161
+ fileUri: 'path/to/recording.wav',
162
+ includeWavHeader: true
163
+ });
164
+ ```
165
+
166
+ #### Choosing the Right Audio Analysis Method
167
+
168
+ | Method | Purpose | Performance | Use When |
169
+ |--------|---------|-------------|----------|
170
+ | `extractAudioAnalysis` | Comprehensive audio feature extraction | Medium-Heavy | You need detailed audio features like MFCC, spectral features |
171
+ | `extractPreview` | Lightweight waveform visualization | Very Light | You only need amplitude data for visualization |
172
+ | `extractAudioData` | Raw PCM data extraction | Medium | You need the raw audio data for custom processing |
173
+ | `extractRawWavAnalysis` | WAV analysis without decoding | Light | You want to analyze WAV files while preserving original values |
174
+ | `extractMelSpectrogram` | Mel spectrogram generation | Heavy | You need frequency-domain representation for ML or visualization |
175
+
176
+ ### Specialized Audio Processing
177
+
178
+ - **extractMelSpectrogram**: Generate mel spectrogram for audio visualization or ML models
179
+ - **trimAudio**: Trim audio files with precision, supporting multiple segments and formats
180
+
181
+ ```typescript
182
+ // Generate mel spectrogram for audio visualization or ML models
183
+ const melSpectrogram = await extractMelSpectrogram({
184
+ fileUri: 'path/to/recording.wav',
185
+ windowSizeMs: 25,
186
+ hopLengthMs: 10,
187
+ nMels: 40
188
+ });
189
+
190
+ // Trim audio files with precision
191
+ const trimmedAudio = await trimAudio({
192
+ fileUri: 'path/to/recording.wav',
193
+ startTimeMs: 1000,
194
+ endTimeMs: 5000,
195
+ outputFormat: { format: 'wav' }
196
+ });
197
+
198
+ // Trim multiple segments from an audio file
199
+ const compiledAudio = await trimAudio({
200
+ fileUri: 'path/to/recording.wav',
201
+ mode: 'keep',
202
+ ranges: [
203
+ { startTimeMs: 1000, endTimeMs: 5000 },
204
+ { startTimeMs: 10000, endTimeMs: 15000 }
205
+ ]
206
+ });
207
+ ```
208
+
209
+ ### Utility Functions
210
+
211
+ - **convertPCMToFloat32**: Convert PCM data to Float32Array for processing
212
+ - **getWavFileInfo**: Extract metadata from WAV files
213
+ - **writeWavHeader**: Create WAV headers for raw PCM data
214
+
215
+ ### Low-Level Access
216
+
217
+ For advanced use cases, the library provides direct access to the native module:
218
+
219
+ ```typescript
220
+ import { ExpoAudioStreamModule } from '@siteed/expo-audio-studio';
221
+
222
+ // Access platform-specific functionality
223
+ const status = await ExpoAudioStreamModule.status();
224
+ const permissions = await ExpoAudioStreamModule.getPermissionsAsync();
225
+ ```
226
+
227
+ ## Documentation
228
+
229
+ For detailed documentation, please refer to the [Getting Started Guide](https://deeeed.github.io/expo-audio-stream/docs/).
230
+
231
+ ## Companion Resources
232
+
233
+ ### AudioPlayground Application
234
+
235
+ The repository includes a complete AudioPlayground application that demonstrates advanced usage of the API. This playground serves as both a demonstration and a learning resource:
236
+
237
+ - Interactive examples of all major API features
238
+ - Real-time audio visualization and analysis
239
+ - Code samples you can directly reference for your own implementation
240
+
241
+ Try it online at [https://deeeed.github.io/expo-audio-stream/playground](https://deeeed.github.io/expo-audio-stream/playground) or run it locally from the repository.
242
+
243
+ ### UI Components Package
244
+
245
+ The [@siteed/expo-audio-ui](https://github.com/deeeed/expo-audio-stream/tree/main/packages/expo-audio-ui) package provides ready-to-use UI components for audio applications:
246
+
247
+ ```bash
248
+ # Install the UI components package
249
+ npm install @siteed/expo-audio-ui
250
+
251
+ # or with yarn
252
+ yarn add @siteed/expo-audio-ui
253
+ ```
254
+
255
+ This package includes:
256
+ - Waveform visualizers
257
+ - Audio recording controls
258
+ - Playback components
259
+ - Spectrogram displays
260
+ - And more!
261
+
262
+ All components are built with React Native, Reanimated, and Skia for optimal performance across platforms.
263
+
264
+ ## License
265
+
266
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
267
+
268
+ ---
269
+ <sub>Created by [Arthur Breton](https://siteed.net) • See more projects at [siteed.net](https://siteed.net)</sub>
@@ -0,0 +1,105 @@
1
+ apply plugin: 'com.android.library'
2
+ apply plugin: 'kotlin-android'
3
+ apply plugin: 'maven-publish'
4
+
5
+ group = 'net.siteed.audiostream'
6
+ version = '0.1.0'
7
+
8
+ buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
15
+ // Simple helper that allows the root project to override versions declared by this library.
16
+ ext.safeExtGet = { prop, fallback ->
17
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18
+ }
19
+
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.8.10")
26
+ }
27
+ }
28
+
29
+ repositories {
30
+ mavenCentral()
31
+ }
32
+
33
+ dependencies {
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
35
+ }
36
+ }
37
+
38
+ afterEvaluate {
39
+ publishing {
40
+ publications {
41
+ release(MavenPublication) {
42
+ from components.release
43
+ }
44
+ }
45
+ repositories {
46
+ maven {
47
+ url = mavenLocal().url
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ android {
54
+ compileSdkVersion safeExtGet("compileSdkVersion", 34)
55
+
56
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
+ if (agpVersion.tokenize('.')[0].toInteger() < 8) {
58
+ compileOptions {
59
+ sourceCompatibility JavaVersion.VERSION_17
60
+ targetCompatibility JavaVersion.VERSION_17
61
+ }
62
+
63
+ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
64
+ kotlinOptions {
65
+ jvmTarget = '17'
66
+ }
67
+ }
68
+ }
69
+
70
+ namespace "net.siteed.audiostream"
71
+ defaultConfig {
72
+ minSdkVersion safeExtGet("minSdkVersion", 21)
73
+ targetSdkVersion safeExtGet("targetSdkVersion", 34)
74
+ versionCode 1
75
+ versionName "0.1.0"
76
+ }
77
+ lintOptions {
78
+ abortOnError false
79
+ }
80
+ publishing {
81
+ singleVariant("release") {
82
+ withSourcesJar()
83
+ }
84
+ }
85
+ }
86
+
87
+ repositories {
88
+ mavenCentral()
89
+ }
90
+
91
+ dependencies {
92
+ implementation project(':expo-modules-core')
93
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
94
+
95
+ // Add testing dependencies
96
+ testImplementation 'junit:junit:4.13.2'
97
+ testImplementation 'org.jetbrains.kotlin:kotlin-test:1.8.10'
98
+ testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.8.10'
99
+ }
100
+
101
+ kotlin {
102
+ jvmToolchain {
103
+ languageVersion.set(JavaLanguageVersion.of(17))
104
+ }
105
+ }
@@ -0,0 +1,27 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <!-- Permissions will be merged into the app's manifest -->
3
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
4
+ <uses-permission android:name="android.permission.RECORD_AUDIO"/>
5
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
6
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
7
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
8
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
9
+
10
+ <application>
11
+ <receiver
12
+ android:name=".RecordingActionReceiver"
13
+ android:exported="false">
14
+ <intent-filter>
15
+ <action android:name="PAUSE_RECORDING" />
16
+ <action android:name="RESUME_RECORDING" />
17
+ <action android:name="STOP_RECORDING" />
18
+ </intent-filter>
19
+ </receiver>
20
+
21
+ <service
22
+ android:name=".AudioRecordingService"
23
+ android:enabled="true"
24
+ android:exported="false"
25
+ android:foregroundServiceType="microphone" />
26
+ </application>
27
+ </manifest>