Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Titanium.Media.AudioPlayer "No audio data found."

Hi,

I am trying to make a very simple test app that plays a sound very quickly and I am getting a strange error. For some reason it says "No audio data found." when the sound is triggered. Here are my settings:

var tone = Titanium.Media.createAudioPlayer({
audioSessionMode:Titanium.Media.AUDIO_SESSION_MODE_PLAYBACK,
preload:true,
url:'beep-1.wav'
});

function runSound(){

bars.backgroundImage = '';
bars.backgroundColor = '#000';
tone.start();

setTimeout(function(){

    bars.backgroundImage = 'test.jpg';
    tone.stop();

}, 33.33);

}

The docs don't really give many examples and have been diffucult to use. If anyone knows what I'm doing wrong that would be excellent. I also tried use the more basic .Sound optoin, but the audio didn't play fast enough. I only need it for 33.33 milliseconds…which is really, really fast.

— asked July 17th 2010 by Seth Aldridge
  • audio
  • audioplayer
  • createaudioplayer
0 Comments

1 Answer

  • Try using the sound object instead of the audioPlayer object. it might suit your needs better.

    The audioPlayer is better suited to streaming remote audio urls, rather than short local sounds.

    http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Media.Sound-object

    hth,
    kosso

    — answered July 18th 2010 by Kosso
    permalink
    1 Comment
    • I am also getting the same error message … I cant use sound object as I am streaming the data from remote URL

      — commented July 5th 2011 by Anish Chandran
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.