@capgo/native-audio 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -42,6 +42,8 @@ public class AudioAsset {
|
|
42
42
|
audio.play(time, callback);
|
43
43
|
playIndex++;
|
44
44
|
playIndex = playIndex % audioList.size();
|
45
|
+
} else {
|
46
|
+
throw new Exception("AudioDispatcher is null");
|
45
47
|
}
|
46
48
|
}
|
47
49
|
|
@@ -84,6 +86,8 @@ public class AudioAsset {
|
|
84
86
|
|
85
87
|
if (audio != null) {
|
86
88
|
audio.resume();
|
89
|
+
} else {
|
90
|
+
throw new Exception("AudioDispatcher is null");
|
87
91
|
}
|
88
92
|
}
|
89
93
|
}
|
@@ -94,6 +98,8 @@ public class AudioAsset {
|
|
94
98
|
|
95
99
|
if (audio != null) {
|
96
100
|
audio.stop();
|
101
|
+
} else {
|
102
|
+
throw new Exception("AudioDispatcher is null");
|
97
103
|
}
|
98
104
|
}
|
99
105
|
}
|
@@ -105,6 +111,8 @@ public class AudioAsset {
|
|
105
111
|
audio.loop();
|
106
112
|
playIndex++;
|
107
113
|
playIndex = playIndex % audioList.size();
|
114
|
+
} else {
|
115
|
+
throw new Exception("AudioDispatcher is null");
|
108
116
|
}
|
109
117
|
}
|
110
118
|
|
@@ -116,6 +124,8 @@ public class AudioAsset {
|
|
116
124
|
|
117
125
|
if (audio != null) {
|
118
126
|
audio.unload();
|
127
|
+
} else {
|
128
|
+
throw new Exception("AudioDispatcher is null");
|
119
129
|
}
|
120
130
|
}
|
121
131
|
|
@@ -132,22 +142,6 @@ public class AudioAsset {
|
|
132
142
|
}
|
133
143
|
}
|
134
144
|
|
135
|
-
/**
|
136
|
-
* Set the playback rate for the player (ignored on API < 23)
|
137
|
-
*
|
138
|
-
* @param volume
|
139
|
-
*/
|
140
|
-
public void setRate(float rate) throws Exception {
|
141
|
-
|
142
|
-
for (int x = 0; x < audioList.size(); x++) {
|
143
|
-
AudioDispatcher audio = audioList.get(x);
|
144
|
-
|
145
|
-
if (audio != null) {
|
146
|
-
audio.setRate(rate);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
}
|
150
|
-
|
151
145
|
public boolean isPlaying() throws Exception {
|
152
146
|
if (audioList.size() != 1) return false;
|
153
147
|
|