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

Test SpeechSynthesisUtterance volume attribute #9642

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>

<head>
<title>5.2.3 SpeechSynthesisUtterance volume attribute test - manual</title>
<script>

var text = "hello universe";
var volumes = [0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333333, 0.9999999999999999];

window.speechSynthesis.cancel();

function handleVoicesChanged() {
volumes.forEach(function(volume) {
var utterance = new SpeechSynthesisUtterance();
utterance.text = "hello universe";
/* https://w3c.github.io/speech-api/speechapi.html#utterance-attributes
volume attribute
This attribute specifies the speaking volume for the utterance.
It ranges between 0 and 1 inclusive, with 0 being the lowest volume and 1 the highest volume, with a default of 1.
If SSML is used, this value will be overridden by prosody tags in the markup.
*/
utterance.volume = volume;
// does the volume of audio output change?
// https://github.com/w3c/web-platform-tests/issues/8795
window.speechSynthesis.speak(utterance);
});
};

window.speechSynthesis.onvoiceschanged = handleVoicesChanged;
window.speechSynthesis.getVoices();

</script>
</head>

<body>
</body>

</html>