react-native-audio-api 0.11.0-nightly-befc3c6-20251202 → 0.11.0-nightly-0d7455c-20251203

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.
@@ -50,7 +50,6 @@ void AudioAPIModule::registerNatives() {
50
50
  makeNativeMethod(
51
51
  "invokeHandlerWithEventNameAndEventBody",
52
52
  AudioAPIModule::invokeHandlerWithEventNameAndEventBody),
53
- makeNativeMethod("closeAllContexts", AudioAPIModule::closeAllContexts),
54
53
  });
55
54
  }
56
55
 
@@ -96,8 +95,4 @@ void AudioAPIModule::invokeHandlerWithEventNameAndEventBody(
96
95
  audioEventHandlerRegistry_->invokeHandlerWithEventBody(eventName->toStdString(), body);
97
96
  }
98
97
  }
99
-
100
- void AudioAPIModule::closeAllContexts() {
101
- AudioAPIModuleInstaller::closeAllContexts();
102
- }
103
98
  } // namespace audioapi
@@ -34,7 +34,6 @@ class AudioAPIModule : public jni::HybridClass<AudioAPIModule> {
34
34
 
35
35
  void injectJSIBindings();
36
36
  void invokeHandlerWithEventNameAndEventBody(jni::alias_ref<jni::JString> eventName, jni::alias_ref<jni::JMap<jstring, jobject>> eventBody);
37
- void closeAllContexts();
38
37
 
39
38
  private:
40
39
  friend HybridBase;
@@ -40,8 +40,6 @@ class AudioAPIModule(
40
40
  eventBody: Map<String, Any>,
41
41
  )
42
42
 
43
- private external fun closeAllContexts()
44
-
45
43
  init {
46
44
  try {
47
45
  System.loadLibrary("react-native-audio-api")
@@ -77,7 +75,7 @@ class AudioAPIModule(
77
75
  }
78
76
 
79
77
  override fun onHostDestroy() {
80
- closeAllContexts()
78
+ // do nothing
81
79
  }
82
80
 
83
81
  override fun initialize() {
@@ -85,7 +83,6 @@ class AudioAPIModule(
85
83
  }
86
84
 
87
85
  override fun invalidate() {
88
- closeAllContexts()
89
86
  reactContext.get()?.removeLifecycleEventListener(this)
90
87
  // think about cleaning up resources, singletons etc.
91
88
  }
@@ -23,9 +23,6 @@ namespace audioapi {
23
23
  using namespace facebook;
24
24
 
25
25
  class AudioAPIModuleInstaller {
26
- private:
27
- inline static std::vector<std::weak_ptr<AudioContext>> contexts_ = {};
28
-
29
26
  public:
30
27
  static void injectJSIBindings(
31
28
  jsi::Runtime *jsiRuntime,
@@ -56,19 +53,6 @@ class AudioAPIModuleInstaller {
56
53
  jsi::Object::createFromHostObject(*jsiRuntime, audioEventHandlerRegistryHostObject));
57
54
  }
58
55
 
59
- static void closeAllContexts() {
60
- for (auto it = contexts_.begin(); it != contexts_.end(); ++it) {
61
- auto weakContext = *it;
62
-
63
- if (auto context = weakContext.lock()) {
64
- context->close();
65
- }
66
-
67
- it = contexts_.erase(it);
68
- --it;
69
- }
70
- }
71
-
72
56
  private:
73
57
  static jsi::Function getCreateAudioContextFunction(
74
58
  jsi::Runtime *jsiRuntime,
@@ -97,7 +81,6 @@ class AudioAPIModuleInstaller {
97
81
 
98
82
  audioContext = std::make_shared<AudioContext>(
99
83
  sampleRate, audioEventHandlerRegistry, runtimeRegistry);
100
- AudioAPIModuleInstaller::contexts_.push_back(audioContext);
101
84
 
102
85
  auto audioContextHostObject =
103
86
  std::make_shared<AudioContextHostObject>(audioContext, &runtime, jsCallInvoker);
@@ -54,7 +54,6 @@ class IIRFilterNode : public AudioNode {
54
54
 
55
55
  private:
56
56
  static constexpr size_t bufferLength = 32;
57
- size_t m_bufferIndex = 0;
58
57
 
59
58
  std::vector<float> feedforward_;
60
59
  std::vector<float> feedback_;
@@ -54,8 +54,6 @@ RCT_EXPORT_MODULE(AudioAPIModule);
54
54
 
55
55
  _eventHandler = nullptr;
56
56
 
57
- audioapi::AudioAPIModuleInstaller::closeAllContexts();
58
-
59
57
  [super invalidate];
60
58
  }
61
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.11.0-nightly-befc3c6-20251202",
3
+ "version": "0.11.0-nightly-0d7455c-20251203",
4
4
  "description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
5
5
  "bin": {
6
6
  "setup-rn-audio-api-web": "./scripts/setup-rn-audio-api-web.js"
@@ -72,7 +72,7 @@
72
72
  "type": "git",
73
73
  "url": "git+https://github.com/software-mansion/react-native-audio-api.git"
74
74
  },
75
- "author": "Software Mansion Labs (https://github.com/software-mansion)",
75
+ "author": "Software Mansion (https://github.com/software-mansion)",
76
76
  "license": "MIT",
77
77
  "bugs": {
78
78
  "url": "https://github.com/software-mansion/react-native-audio-api/issues"
@@ -84,12 +84,7 @@
84
84
  "peerDependencies": {
85
85
  "react": "*",
86
86
  "react-native": "*",
87
- "react-native-worklets": ">= 0.6.0"
88
- },
89
- "peerDependenciesMeta": {
90
- "react-native-worklets": {
91
- "optional": true
92
- }
87
+ "react-native-worklets": "*"
93
88
  },
94
89
  "devDependencies": {
95
90
  "@babel/cli": "^7.20.0",