Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-527] setTimeout and sound

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:53:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelsios, iphone, media, sound
ReporterNolan Wright
AssigneeJeff Haynie
Created2011-04-15T02:31:03.000+0000
Updated2011-04-17T01:53:24.000+0000

Description

from community. create and play sound in a set timeout. fire 3 setTimeouts and the sound stops playing after the 3rd time. sound file is attached. fyi - issue does not occur if sound variable is declared outside of setTimeout (i.e., var siren = null;)

var label = Titanium.UI.createLabel({

color: '#fff',
text:'Sound will stop in 3 ...',
textAlign: 'center',
font:{fontSize:20,fontFamily:'Helvetica Neue'}

}); win.add(label);

setTimeout(function(){

var siren= Ti.Media.createSound({url:'airraid.wav'});
siren.play();

}, 1);

setTimeout(function(){ label.text = '2'; }, 1000);
setTimeout(function(){ label.text = '1'; }, 2000);
setTimeout(function(){ label.text = 'Stopped'; }, 3000);

Attachments

FileDateSize
airraid.wav2011-04-15T02:31:03.000+00001611404

Comments

  1. Stephen Tramer 2011-04-15

    Not seeing this behavior any longer.

JSON Source