Tag and build

This commit is contained in:
Angelos Chalaris
2017-12-14 20:49:06 +02:00
parent 828023d4ea
commit 3f8ca8d615
2 changed files with 23 additions and 0 deletions

View File

@ -73,6 +73,9 @@
* [Powerset](#powerset)
* [Standard deviation](#standard-deviation)
### Media
* [Speech_synthesis (experimental)](#speech_synthesis-experimental)
### Object
* [Object from key value pairs](#object-from-key-value-pairs)
* [Object to key value pairs](#object-to-key-value-pairs)
@ -812,6 +815,25 @@ const standardDeviation = (arr, usePopulation = false) => {
// standardDeviation([10,2,38,23,38,23,21], true) -> 12.29899614287479 (population)
```
[⬆ back to top](#table-of-contents)
## Media
### Speech synthesis (experimental)
Use `SpeechSynthesisUtterance.voice` and `indow.speechSynthesis.getVoices()` to convert a message to speech.
Use `window.speechSynthesis.speak()` to play the message.
Learn more about the [SpeechSynthesisUtterance interface of the Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance).
```js
const speak = message => {
const msg = new SpeechSynthesisUtterance(message);
msg.voice = window.speechSynthesis.getVoices()[0];
window.speechSynthesis.speak(msg);
}
// speak('Hello, World') -> plays the message
```
[⬆ back to top](#table-of-contents)
## Object

View File

@ -68,6 +68,7 @@ shuffle-array:array
similarity-between-arrays:array
sleep:function
sort-characters-in-string-(alphabetical):string
speech_synthesis-(experimental):media
standard-deviation:math
sum-of-array-of-numbers:array
swap-values-of-two-variables:utility