react-native-audio-api 0.6.2-rc.3 → 0.6.2-rc.4

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.
@@ -67,6 +67,7 @@ class AudioAPIModule(
67
67
  category: String?,
68
68
  mode: String?,
69
69
  options: ReadableArray?,
70
+ allowHaptics: Boolean,
70
71
  ) {
71
72
  // noting to do here
72
73
  }
@@ -48,7 +48,7 @@
48
48
 
49
49
  @ReactMethod
50
50
  @DoNotStrip
51
- public abstract void setAudioSessionOptions(String category, String mode, ReadableArray options);
51
+ public abstract void setAudioSessionOptions(String category, String mode, ReadableArray options, boolean allowHaptics);
52
52
 
53
53
  @ReactMethod
54
54
  @DoNotStrip
@@ -71,13 +71,14 @@ class AudioBufferQueueSourceNodeHostObject
71
71
  auto audioBufferQueueSourceNode =
72
72
  std::static_pointer_cast<AudioBufferQueueSourceNode>(node_);
73
73
 
74
- if (args[1].isUndefined()) {
75
- audioBufferQueueSourceNode->start(when);
76
- } else {
77
- auto offset = args[1].asNumber();
78
- audioBufferQueueSourceNode->start(when, offset);
74
+ double offset = -1.0;
75
+
76
+ if (args[1].isNumber()) {
77
+ offset = args[1].asNumber();
79
78
  }
80
79
 
80
+ audioBufferQueueSourceNode->start(when, offset);
81
+
81
82
  return jsi::Value::undefined();
82
83
  }
83
84
 
@@ -47,15 +47,12 @@ std::shared_ptr<AudioParam> AudioBufferQueueSourceNode::getPlaybackRateParam()
47
47
  return playbackRateParam_;
48
48
  }
49
49
 
50
- void AudioBufferQueueSourceNode::start(double when) {
51
- AudioScheduledSourceNode::start(when);
52
- isPaused_ = false;
53
- }
54
-
55
50
  void AudioBufferQueueSourceNode::start(double when, double offset) {
56
- start(when);
51
+ AudioScheduledSourceNode::start(when);
57
52
 
58
- vReadIndex_ = static_cast<double>(context_->getSampleRate() * offset);
53
+ if (offset >= 0.0) {
54
+ vReadIndex_ = static_cast<double>(context_->getSampleRate() * offset);
55
+ }
59
56
  }
60
57
 
61
58
  void AudioBufferQueueSourceNode::stop(double when) {
@@ -23,7 +23,6 @@ class AudioBufferQueueSourceNode : public AudioScheduledSourceNode {
23
23
  [[nodiscard]] std::shared_ptr<AudioParam> getDetuneParam() const;
24
24
  [[nodiscard]] std::shared_ptr<AudioParam> getPlaybackRateParam() const;
25
25
 
26
- void start(double when) override;
27
26
  void start(double when, double offset);
28
27
  void stop(double when) override;
29
28
  void pause();
@@ -28,7 +28,7 @@ class AudioScheduledSourceNode : public AudioNode {
28
28
  enum class PlaybackState { UNSCHEDULED, SCHEDULED, PLAYING, STOP_SCHEDULED, FINISHED };
29
29
  explicit AudioScheduledSourceNode(BaseAudioContext *context);
30
30
 
31
- virtual void start(double when);
31
+ void start(double when);
32
32
  virtual void stop(double when);
33
33
 
34
34
  bool isUnscheduled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.6.2-rc.3",
3
+ "version": "0.6.2-rc.4",
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"