react-native-audio-api 0.9.0-nightly-7ecb495-20251008 → 0.9.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 (106) hide show
  1. package/android/src/main/cpp/audioapi/android/core/{utils/AudioDecoder.cpp → AudioDecoder.cpp} +75 -79
  2. package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
  3. package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
  4. package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
  5. package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
  6. package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
  7. package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
  8. package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
  9. package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
  10. package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
  11. package/android/src/main/jniLibs/x86/libavformat.so +0 -0
  12. package/android/src/main/jniLibs/x86/libavutil.so +0 -0
  13. package/android/src/main/jniLibs/x86/libswresample.so +0 -0
  14. package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
  15. package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
  16. package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
  17. package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
  18. package/common/cpp/audioapi/AudioAPIModuleInstaller.h +43 -124
  19. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +101 -1
  20. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +3 -0
  21. package/common/cpp/audioapi/HostObjects/sources/AudioBufferHostObject.cpp +3 -8
  22. package/common/cpp/audioapi/core/AudioContext.cpp +2 -0
  23. package/common/cpp/audioapi/core/BaseAudioContext.cpp +35 -0
  24. package/common/cpp/audioapi/core/BaseAudioContext.h +12 -4
  25. package/common/cpp/audioapi/core/OfflineAudioContext.cpp +2 -0
  26. package/common/cpp/audioapi/core/effects/WorkletNode.cpp +16 -28
  27. package/common/cpp/audioapi/core/effects/WorkletNode.h +2 -3
  28. package/common/cpp/audioapi/core/effects/WorkletProcessingNode.cpp +5 -6
  29. package/common/cpp/audioapi/core/sources/AudioBuffer.h +1 -0
  30. package/common/cpp/audioapi/core/sources/AudioBufferBaseSourceNode.cpp +0 -4
  31. package/common/cpp/audioapi/core/sources/AudioBufferBaseSourceNode.h +0 -1
  32. package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp +0 -2
  33. package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.cpp +0 -4
  34. package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.h +0 -1
  35. package/common/cpp/audioapi/core/sources/StreamerNode.cpp +16 -6
  36. package/common/cpp/audioapi/core/sources/StreamerNode.h +3 -1
  37. package/common/cpp/audioapi/core/sources/WorkletSourceNode.cpp +2 -3
  38. package/common/cpp/audioapi/core/utils/AudioDecoder.h +91 -36
  39. package/common/cpp/audioapi/core/utils/Constants.h +0 -4
  40. package/common/cpp/audioapi/events/AudioEventHandlerRegistry.cpp +5 -1
  41. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
  42. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
  43. package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +5 -5
  44. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
  45. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
  46. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
  47. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
  48. package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +5 -5
  49. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
  50. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
  51. package/common/cpp/audioapi/jsi/AudioArrayBuffer.cpp +2 -2
  52. package/common/cpp/audioapi/jsi/AudioArrayBuffer.h +10 -11
  53. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp +282 -241
  54. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h +19 -57
  55. package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +1 -1
  56. package/common/cpp/audioapi/utils/AudioBus.cpp +4 -0
  57. package/common/cpp/audioapi/utils/AudioBus.h +1 -0
  58. package/common/cpp/test/CMakeLists.txt +8 -5
  59. package/common/cpp/test/RunTests.sh +2 -2
  60. package/common/cpp/test/{AudioParamTest.cpp → src/AudioParamTest.cpp} +1 -1
  61. package/common/cpp/test/src/ConstantSourceTest.cpp +64 -0
  62. package/common/cpp/test/{GainTest.cpp → src/GainTest.cpp} +11 -10
  63. package/common/cpp/test/{MockAudioEventHandlerRegistry.h → src/MockAudioEventHandlerRegistry.h} +4 -2
  64. package/common/cpp/test/{OscillatorTest.cpp → src/OscillatorTest.cpp} +6 -4
  65. package/common/cpp/test/{StereoPannerTest.cpp → src/StereoPannerTest.cpp} +1 -1
  66. package/ios/audioapi/ios/core/AudioDecoder.mm +156 -0
  67. package/lib/commonjs/api.js +1 -21
  68. package/lib/commonjs/api.js.map +1 -1
  69. package/lib/commonjs/core/BaseAudioContext.js +18 -11
  70. package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
  71. package/lib/module/api.js +1 -3
  72. package/lib/module/api.js.map +1 -1
  73. package/lib/module/core/BaseAudioContext.js +18 -11
  74. package/lib/module/core/BaseAudioContext.js.map +1 -1
  75. package/lib/typescript/api.d.ts +1 -5
  76. package/lib/typescript/api.d.ts.map +1 -1
  77. package/lib/typescript/core/BaseAudioContext.d.ts +6 -3
  78. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
  79. package/lib/typescript/interfaces.d.ts +3 -10
  80. package/lib/typescript/interfaces.d.ts.map +1 -1
  81. package/package.json +1 -1
  82. package/src/api.ts +0 -10
  83. package/src/core/BaseAudioContext.ts +29 -26
  84. package/src/interfaces.ts +6 -26
  85. package/common/cpp/audioapi/HostObjects/utils/AudioDecoderHostObject.cpp +0 -133
  86. package/common/cpp/audioapi/HostObjects/utils/AudioDecoderHostObject.h +0 -28
  87. package/common/cpp/audioapi/HostObjects/utils/AudioStretcherHostObject.cpp +0 -58
  88. package/common/cpp/audioapi/HostObjects/utils/AudioStretcherHostObject.h +0 -26
  89. package/common/cpp/audioapi/core/types/AudioFormat.h +0 -16
  90. package/common/cpp/audioapi/core/utils/AudioStretcher.cpp +0 -75
  91. package/common/cpp/audioapi/core/utils/AudioStretcher.h +0 -30
  92. package/ios/audioapi/ios/core/utils/AudioDecoder.mm +0 -160
  93. package/lib/commonjs/core/AudioDecoder.js +0 -48
  94. package/lib/commonjs/core/AudioDecoder.js.map +0 -1
  95. package/lib/commonjs/core/AudioStretcher.js +0 -31
  96. package/lib/commonjs/core/AudioStretcher.js.map +0 -1
  97. package/lib/module/core/AudioDecoder.js +0 -42
  98. package/lib/module/core/AudioDecoder.js.map +0 -1
  99. package/lib/module/core/AudioStretcher.js +0 -26
  100. package/lib/module/core/AudioStretcher.js.map +0 -1
  101. package/lib/typescript/core/AudioDecoder.d.ts +0 -4
  102. package/lib/typescript/core/AudioDecoder.d.ts.map +0 -1
  103. package/lib/typescript/core/AudioStretcher.d.ts +0 -3
  104. package/lib/typescript/core/AudioStretcher.d.ts.map +0 -1
  105. package/src/core/AudioDecoder.ts +0 -78
  106. package/src/core/AudioStretcher.ts +0 -43
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libavformat.framework/libavformat</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
11
+ <string>ios-arm64_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libavformat.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
+ <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
20
23
  </dict>
21
24
  <dict>
22
25
  <key>BinaryPath</key>
23
26
  <string>libavformat.framework/libavformat</string>
24
27
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
26
29
  <key>LibraryPath</key>
27
30
  <string>libavformat.framework</string>
28
31
  <key>SupportedArchitectures</key>
29
32
  <array>
30
33
  <string>arm64</string>
31
- <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libswresample.framework/libswresample</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libswresample.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>x86_64</string>
18
17
  </array>
19
18
  <key>SupportedPlatform</key>
20
19
  <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
20
  </dict>
24
21
  <dict>
25
22
  <key>BinaryPath</key>
26
23
  <string>libswresample.framework/libswresample</string>
27
24
  <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
25
+ <string>ios-arm64_x86_64-simulator</string>
29
26
  <key>LibraryPath</key>
30
27
  <string>libswresample.framework</string>
31
28
  <key>SupportedArchitectures</key>
32
29
  <array>
33
30
  <string>arm64</string>
31
+ <string>x86_64</string>
34
32
  </array>
35
33
  <key>SupportedPlatform</key>
36
34
  <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -3,11 +3,11 @@
3
3
  namespace audioapi {
4
4
 
5
5
  size_t AudioArrayBuffer::size() const {
6
- return size_;
6
+ return audioArray_->getSize() * sizeof(float);
7
7
  }
8
8
 
9
9
  uint8_t *AudioArrayBuffer::data() {
10
- return data_;
10
+ return reinterpret_cast<uint8_t *>(audioArray_->getData());
11
11
  }
12
12
 
13
13
  } // namespace audioapi
@@ -1,6 +1,10 @@
1
1
  #pragma once
2
2
 
3
3
  #include <jsi/jsi.h>
4
+ #include <audioapi/utils/AudioArray.h>
5
+
6
+ #include <memory>
7
+ #include <utility>
4
8
 
5
9
  namespace audioapi {
6
10
 
@@ -8,16 +12,12 @@ using namespace facebook;
8
12
 
9
13
  class AudioArrayBuffer : public jsi::MutableBuffer {
10
14
  public:
11
- AudioArrayBuffer(uint8_t *data, size_t size): data_(data), size_(size) {}
12
- ~AudioArrayBuffer() override {
13
- if (data_ == nullptr) {
14
- return;
15
- }
16
- delete[] data_;
17
- }
15
+ explicit AudioArrayBuffer(const std::shared_ptr<AudioArray> &audioArray): audioArray_(audioArray) {}
16
+ ~AudioArrayBuffer() override = default;
17
+
18
18
  AudioArrayBuffer(AudioArrayBuffer &&other) noexcept
19
- : data_(other.data_), size_(other.size_) {
20
- other.data_ = nullptr;
19
+ : audioArray_(std::move(other.audioArray_)) {
20
+ other.audioArray_ = nullptr;
21
21
  }
22
22
 
23
23
  AudioArrayBuffer(const AudioArrayBuffer &) = delete;
@@ -28,8 +28,7 @@ class AudioArrayBuffer : public jsi::MutableBuffer {
28
28
  uint8_t *data() override;
29
29
 
30
30
  private:
31
- uint8_t *data_;
32
- const size_t size_;
31
+ std::shared_ptr<AudioArray> audioArray_;
33
32
  };
34
33
 
35
34
  } // namespace audioapi