Skip to content

Commit

Permalink
Update synthesis.speak()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jae-Yoon Chung committed May 23, 2019
1 parent 302db5a commit fd7bbb1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/demos/sound/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function main(sources) {
next: s => console.debug("reducer state", s)
});

const goal$ = sources.DOM.select("button").events("click")
const goal$ = sources.DOM.select("button")
.events("click")
.mapTo({
goal_id: { stamp: Date.now(), goal_id: "ap" },
goal:
Expand Down
7 changes: 6 additions & 1 deletion examples/demos/speech/dist/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions speech/src/makeSpeechSynthesisDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export function makeSpeechSynthesisDriver(): Driver<any, EventSource> {
}
});
synthesis.speak(utterance);
// https://www.chromestatus.com/feature/5687444770914304
if (!synthesis.speaking) {
console.warn('Cannot speak utterance; dispatching "ended"');
utterance.dispatchEvent(new Event("ended"));
}
}
}
});
Expand Down

0 comments on commit fd7bbb1

Please sign in to comment.