Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome continues output after pause() #21

Open
parente opened this issue May 23, 2010 · 1 comment
Open

Chrome continues output after pause() #21

parente opened this issue May 23, 2010 · 1 comment

Comments

@parente
Copy link
Member

parente commented May 23, 2010

This is an upstream bug and only happens in Chrome. Looks timing related.

  1. Call play() on audio.
  2. Wait a bit (e.g., 10ms).
  3. Call pause() on it.
  4. Call play() on another audio element.
  5. Chrome fires the pause callback for the first, but it's output continues on top of the second.

The "paused" flag on the second element reports "true" so Chrome thinks it has paused the audio, but output still continues.

Trace from a unit test exhibiting the problem:

JSonic.js:17 info.mindtrove.initJSonic = function(args)
trace.js:53JSonic.js:18 if(!info.mindtrove._jsonicInstance)
trace.js:53JSonic.js:32 constructor: function()
trace.js:53JSonic.js:39 postMixInProperties: function()
trace.js:53JSonic.js:386 postMixInProperties: function()
trace.js:53JSonic.js:392 if(localStorage)
trace.js:53JSonic.js:415 if(node.canPlayType('audio/ogg') && node.canPlayType('audio/ogg') != 'no')
trace.js:53interrupt.js:34 test('say 1, stop, say 1 again', 4, function()
trace.js:53JSonic.js:104 say: function(args)
trace.js:53JSonic.js:290 _getChannel: function(id)
trace.js:53JSonic.js:293 if(ch === undefined)
trace.js:53JSonic.js:596 postMixInProperties: function()
trace.js:53JSonic.js:750 _reset: function(args)
trace.js:53JSonic.js:626 push: function(args)
trace.js:53JSonic.js:310 constructor: function()
trace.js:53JSonic.js:642 else if(args.method == '_say')
trace.js:53JSonic.js:513 getSpeech: function(args, props)
trace.js:53JSonic.js:497 _getSpeechCacheKey: function(text, props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:675 _pump: function()
trace.js:53JSonic.js:676 while(!this._busy && this._queue.length)

** first started

trace.js:53JSonic.js:702 _say: function(args)
trace.js:53JSonic.js:320 callBefore: function(callback)
trace.js:53JSonic.js:330 callAfter: function(callback)
trace.js:53JSonic.js:572 _onSpeechSynthed: function(resultDef, args, response)
trace.js:53JSonic.js:580 if(args.cache)

** first started callback

trace.js:53JSonic.js:683 _playAudioNode: function(args, node)
trace.js:53JSonic.js:876 _onStart: function(event)
trace.js:53JSonic.js:883 if(dojo.isChrome)

trace.js:53interrupt.js:40 def1.callBefore(function()
trace.js:53JSonic.js:763 _notify: function(notice)
trace.js:53interrupt.js:43 setTimeout(function()
trace.js:53JSonic.js:153 stop: function(args)
trace.js:53JSonic.js:290 _getChannel: function(id)
trace.js:53JSonic.js:626 push: function(args)
trace.js:53JSonic.js:310 constructor: function()
trace.js:53JSonic.js:635 else if(args.method == '_stop')

** first stopped

trace.js:53JSonic.js:719 _stop: function(args)
trace.js:53JSonic.js:722 if(this._audioNode)

** second queued

trace.js:53JSonic.js:104 say: function(args)
trace.js:53JSonic.js:290 _getChannel: function(id)
trace.js:53JSonic.js:626 push: function(args)
trace.js:53JSonic.js:310 constructor: function()
trace.js:53JSonic.js:642 else if(args.method == '_say')
trace.js:53JSonic.js:513 getSpeech: function(args, props)
trace.js:53JSonic.js:497 _getSpeechCacheKey: function(text, props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:502 for(var name in props)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:507 dojo.forEach(names, function(name)
trace.js:53JSonic.js:520 if(audioNode)
trace.js:53JSonic.js:675 _pump: function()
trace.js:53JSonic.js:320 callBefore: function(callback)
trace.js:53JSonic.js:330 callAfter: function(callback)

** first stopped callback

trace.js:53JSonic.js:818 _onPause: function(event)
trace.js:53JSonic.js:830 if(cargs && cargs.started)
trace.js:53interrupt.js:54 callAfter(function(completed)
trace.js:53JSonic.js:763 _notify: function(notice)
trace.js:53JSonic.js:675 _pump: function()
trace.js:53JSonic.js:676 while(!this._busy && this._queue.length)

** second started

trace.js:53JSonic.js:702 _say: function(args)
trace.js:53JSonic.js:683 _playAudioNode: function(args, node)

** second started callback

trace.js:53JSonic.js:876 _onStart: function(event)
trace.js:53JSonic.js:883 if(dojo.isChrome)
trace.js:53interrupt.js:46 def2.callBefore(function()
trace.js:53JSonic.js:763 _notify: function(notice)

** second finished callback

trace.js:53JSonic.js:845 _onEnd: function(event)
trace.js:53interrupt.js:49 callAfter(function(completed)
trace.js:53JSonic.js:763 _notify: function(notice)
trace.js:53JSonic.js:675 _pump: function()
trace.js:53JSonic.js:428 resetCache: function(args)
trace.js:53JSonic.js:429 if(localStorage)
trace.js:53JSonic.js:51 uninitialize: function()
trace.js:53JSonic.js:52 for(var ch in this._channels)
trace.js:53JSonic.js:619 uninitialize: function()

@parente
Copy link
Member Author

parente commented May 23, 2010

Workaround in 4b9021a. Set volume to 0.0 in pause callback. Hides the fact that output is still happening. Works fine because further callbacks are suppressed by dojo.disconnect and dojo.destroy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant