@@ -26,7 +26,7 @@ export interface IAudioCueService {
2626 onEnabledChanged ( cue : AudioCue ) : Event < void > ;
2727
2828 playSound ( cue : Sound , allowManyInParallel ?: boolean ) : Promise < void > ;
29- playAudioCueLoop ( cue : AudioCue ) : IDisposable ;
29+ playAudioCueLoop ( cue : AudioCue , milliseconds : number ) : IDisposable ;
3030 playRandomAudioCue ( groupId : AudioCueGroupId , allowManyInParallel ?: boolean ) : void ;
3131}
3232
@@ -75,10 +75,11 @@ export class AudioCueService extends Disposable implements IAudioCueService {
7575 private readonly playingSounds = new Set < Sound > ( ) ;
7676
7777 public async playSound ( sound : Sound , allowManyInParallel = false ) : Promise < void > {
78+ console . log ( sound . fileName , allowManyInParallel ) ;
7879 if ( ! allowManyInParallel && this . playingSounds . has ( sound ) ) {
7980 return ;
8081 }
81-
82+ console . log ( 'playing' , sound . fileName ) ;
8283 this . playingSounds . add ( sound ) ;
8384 const url = FileAccess . asBrowserUri ( `vs/platform/audioCues/browser/media/${ sound . fileName } ` ) . toString ( true ) ;
8485
@@ -99,14 +100,16 @@ export class AudioCueService extends Disposable implements IAudioCueService {
99100 }
100101 }
101102
102- public playAudioCueLoop ( cue : AudioCue ) : IDisposable {
103+ public playAudioCueLoop ( cue : AudioCue , milliseconds : number ) : IDisposable {
103104 let playing = true ;
104105 const playSound = ( ) => {
105106 if ( playing ) {
106107 this . playAudioCue ( cue , true ) . finally ( ( ) => {
107- if ( playing ) {
108- playSound ( ) ;
109- }
108+ setTimeout ( ( ) => {
109+ if ( playing ) {
110+ playSound ( ) ;
111+ }
112+ } , milliseconds ) ;
110113 } ) ;
111114 }
112115 } ;
0 commit comments