If I create a sound object and then try to play it, app immediately crashes. I need to set it's url in another eventListener but even if I specify a url directly it still crashes.
If I comment out the audio.play() line, no crash;
Ideas?? Pulling my hair out!! Thx!
// Play selected audio file var audio = Ti.Media.createSound(); audio.url = 'files/audio/filename.mp3'; audio.preload = true; var play = Titanium.UI.createButton({ title:'Play', height:40, width:125, left:10, top:10 }); play.addEventListener('click', function() { audio.play(); Ti.API.info(audio.url); // can see it here });
1 Answer
How long is the sound? Have you tried it with createAudioPlayer() instead? I recall that createSound() is intended for short sounds (like system sounds) while createAudioPlayer() is intended for longer sounds (like music).
Your Answer
Think you can help? Login to answer this question!