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.Sound.stop() does not stop looping sounds.

Title says it all. When you create a sound and set the looping property to true the stop() method won't actually stop the sound. It continues to loop!

See example below:

// Create a looping sound and play it
var sound = Titanium.Media.createSound("app://test_sound.mp3");
sound.setLooping(true);
sound.play();

// After 5 seconds, stop the sound, except that it doesn't :(
window.setTimeout(function () {
    sound.stop();
}, 5000);
— asked July 9th 2010 by Geoff Blair
  • desktop
  • osx
  • sound
2 Comments
  • What version of Ti SDK are you using? There were some bugs in 1.3.2 that were fixed in 1.3.3

    — commented July 9th 2010 by karlo kilayko
  • this appears to be an issue in 3.1 :/

    — commented August 8th 2013 by Anthony Catalano

2 Answers

  • sound.setLooping(false);

    sound.stop();

    will stop it.

    — answered September 18th 2011 by Simon Fry
    permalink
    0 Comments
  • can man control the loop for 5 times like example ?

    — answered September 24th 2013 by Mohammed Abunada
    permalink
    0 Comments
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.