Merge pull request #185361 from microsoft/merogge/cue-touch-up

follow up cue work
This commit is contained in:
Megan Rogge 2023-06-16 12:57:02 -05:00 committed by GitHub
commit af93ce2437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,6 +53,10 @@ export class AudioCueService extends Disposable implements IAudioCueService {
await Promise.all(Array.from(sounds).map(sound => this.playSound(sound, true)));
}
/**
* Gaming and other apps often play a sound variant when the same event happens again
* for an improved experience. This function plays a random sound from the given group to accomplish that.
*/
public playRandomAudioCue(groupId: AudioCueGroupId, allowManyInParallel?: boolean): void {
const cues = AudioCue.allAudioCues.filter(cue => cue.groupId === groupId);
const index = Math.floor(Math.random() * cues.length);
@ -350,7 +354,7 @@ export class AudioCue {
settingsKey: 'audioCues.chatRequestSent'
});
public static readonly chatResponseReceived = {
private static readonly chatResponseReceived = {
name: localize('audioCues.chatResponseReceived', 'Chat Response Received'),
settingsKey: 'audioCues.chatResponseReceived',
groupId: AudioCueGroupId.chatResponseReceived