问题
every time I call my function to use .wav files I get these errors:
ERROR: 180: EXCEPTION thrown ('dev!'): -
and
ERROR:> aqsrv> 70: Exception caught in (null) - Error -1
it always happens in the line of play()
.
It only happens in IOS - on android it runs well.
Function:
function sonido() {
var cont=0;
//console.log(arregloDetalles[cont].tVelocidad);
var intervalo=setInterval(function() {
if(bnaddetener==1){
clearInterval(intervalo);
}
if(arregloDetalles[cont].click_clack==1) {
soundclick.play();
} else {
soundclack.play();
console.log("Clack");
}
cont++;
if(cont==arregloDetalles.length) {
banderaclick=1;
cont=0;
}
} ,arregloDetalles[cont].tVelocidad);
}
declaration of .wav files:
var soundclick = Titanium.Media.createSound({
url:'/sonidos/beep-8.wav',
preload:true
});
soundclick.addEventListener('complete', function(e) { soundclick.release(); });
var soundclack = Titanium.Media.createSound({
url:'/sonidos/beep-7.wav',
preload:true
});
soundclack.addEventListener('complete', function(e) { soundclack.release(); });
回答1:
Seems like is trying to get the input device sample rate. That will not work on iOS Simulator, you need to test on a real device.
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/TestingontheiOSSimulator.html
来源:https://stackoverflow.com/questions/28995254/error-180-exception-thrown-dev-and-error-aqsrv-70-exception-caught