react-native-audio-api 0.7.1-nightly-b6583fe-20250813 → 0.7.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.
@@ -72,8 +72,10 @@ void AudioNodeManager::settlePendingConnections() {
72
72
  assert(to != nullptr);
73
73
  from->disconnectNode(to);
74
74
  } else {
75
- for (auto &node : from->outputNodes_) {
76
- from->disconnectNode(node);
75
+ for (auto it = from->outputNodes_.begin(); it != from->outputNodes_.end();) {
76
+ auto next = std::next(it);
77
+ from->disconnectNode(*it);
78
+ it = next;
77
79
  }
78
80
  }
79
81
  }
@@ -35,11 +35,10 @@
35
35
  - (bool)start
36
36
  {
37
37
  NSLog(@"[AudioPlayer] start");
38
-
38
+
39
39
  AudioEngine *audioEngine = [AudioEngine sharedInstance];
40
40
  assert(audioEngine != nil);
41
- self.sourceNodeId = [audioEngine attachSourceNode:self.sourceNode format:self.format];
42
-
41
+
43
42
  // AudioEngine allows us to attach and connect nodes at runtime but with few limitations
44
43
  // in this case if it is the first player and recorder started the engine we need to restart.
45
44
  // It can be optimized by tracking if we haven't break rules of at runtime modifications from docs
@@ -47,7 +46,9 @@
47
46
  //
48
47
  // Currently we are restarting because we do not see any significant performance issue and case when
49
48
  // you will need to start and stop player very frequently
50
- return [audioEngine restartAudioEngine];
49
+ [audioEngine stopEngine];
50
+ self.sourceNodeId = [audioEngine attachSourceNode:self.sourceNode format:self.format];
51
+ return [audioEngine startIfNecessary];
51
52
  }
52
53
 
53
54
  - (void)stop
@@ -57,7 +58,6 @@
57
58
  AudioEngine *audioEngine = [AudioEngine sharedInstance];
58
59
  assert(audioEngine != nil);
59
60
  [audioEngine detachSourceNodeWithId:self.sourceNodeId];
60
- [audioEngine restartAudioEngine];
61
61
  [audioEngine stopIfNecessary];
62
62
  self.sourceNodeId = nil;
63
63
  }
@@ -67,9 +67,8 @@
67
67
  NSLog(@"[AudioPlayer] resume");
68
68
  AudioEngine *audioEngine = [AudioEngine sharedInstance];
69
69
  assert(audioEngine != nil);
70
- [audioEngine startEngine];
71
70
 
72
- return [audioEngine startEngine];
71
+ return [audioEngine startIfNecessary];
73
72
  }
74
73
 
75
74
  - (void)suspend
@@ -100,7 +100,6 @@
100
100
  {
101
101
  AudioEngine *audioEngine = [AudioEngine sharedInstance];
102
102
  assert(audioEngine != nil);
103
- [audioEngine attachInputNode:self.sinkNode];
104
103
 
105
104
  // AudioEngine allows us to attach and connect nodes at runtime but with few limitations
106
105
  // in this case if it is the first recorder node and player started the engine we need to restart.
@@ -109,7 +108,9 @@
109
108
  //
110
109
  // Currently we are restarting because we do not see any significant performance issue and case when
111
110
  // you will need to start and stop recorder very frequently
112
- [audioEngine restartAudioEngine];
111
+ [audioEngine stopEngine];
112
+ [audioEngine attachInputNode:self.sinkNode];
113
+ [audioEngine startIfNecessary];
113
114
  }
114
115
 
115
116
  - (void)stop
@@ -117,7 +118,6 @@
117
118
  AudioEngine *audioEngine = [AudioEngine sharedInstance];
118
119
  assert(audioEngine != nil);
119
120
  [audioEngine detachInputNode];
120
- [audioEngine restartAudioEngine];
121
121
  [audioEngine stopIfNecessary];
122
122
  }
123
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.7.1-nightly-b6583fe-20250813",
3
+ "version": "0.7.1",
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"