@capgo/native-audio 6.0.10 → 6.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,12 +69,16 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
69
69
  }
70
70
 
71
71
  func play(time: TimeInterval) {
72
- let player: AVAudioPlayer = channels[playIndex]
73
- player.currentTime = time
74
- player.numberOfLoops = 0
75
- player.play()
76
- playIndex += 1
77
- playIndex = playIndex % channels.count
72
+ let player: AVAudioPlayer
73
+
74
+ if channels.count > 0 {
75
+ player = channels[playIndex]
76
+ player.currentTime = time
77
+ player.numberOfLoops = 0
78
+ player.play()
79
+ playIndex += 1
80
+ playIndex = playIndex % channels.count
81
+ }
78
82
  }
79
83
 
80
84
  func playWithFade(time: TimeInterval) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "6.0.10",
3
+ "version": "6.0.11",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "main": "dist/plugin.js",
6
6
  "module": "dist/esm/index.js",