Skip to content

Commit

Permalink
canberra: set a media role on hotword sounds
Browse files Browse the repository at this point in the history
That way, we're not affected by the system alert sound volume
  • Loading branch information
gcampax committed Aug 3, 2020
1 parent a701375 commit 7b9a5a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async function init(platform) {
});
try {
eventSoundCtx.cache({
'media.role': 'voice-assistant',
[canberra.Property.EVENT_ID]: 'message-new-instant'
});
} catch (e) {
Expand All @@ -98,6 +99,7 @@ async function init(platform) {

speech.on('wakeword', (hotword) => {
eventSoundCtx.play(HOTWORD_DETECTED_ID, {
'media.role': 'voice-assistant',
[canberra.Property.EVENT_ID]: 'message-new-instant'
}).catch((e) => {
console.error(`Failed to play hotword detection sound: ${e.message}`);
Expand Down

0 comments on commit 7b9a5a9

Please sign in to comment.