Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eoinsha/node-saytime
Text-to-speech (TTS) for spoken audio of sentences with timestamps on macOS/OSX
https://github.com/eoinsha/node-saytime
Last synced: 15 days ago
JSON representation
Text-to-speech (TTS) for spoken audio of sentences with timestamps on macOS/OSX
- Host: GitHub
- URL: https://github.com/eoinsha/node-saytime
- Owner: eoinsha
- Created: 2016-10-18T21:30:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-20T12:45:27.000Z (about 8 years ago)
- Last Synced: 2024-12-20T14:07:19.306Z (18 days ago)
- Language: JavaScript
- Size: 3.27 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
saytime
===Saytime generates an audio file from provided text using the macOS `say` command.
In addition, it provides the timestamp and duration for each spoken sentence along with the text of each sentence.That allows the output to be used for synchronized playback testing and video subtitle rendering verification.
# Compatibility
saytime requires:
* macOS with `say`
* Node 6+
* ffmpeg (providing the `ffmpeg` and `ffprobe` commands)# Usage
See the `examples` directory for more.
```javascript
const saytime = require('saytime');
saytime(`
There once was a young lady named bright
Whose speed was much faster than light
She set out one day
In a relative way
And returned on the previous night.
`, { out: 'output.wav' }, (err, result) => {
if (!err) {
console.log('RESULT', result);
}
});
```Output:
```
RESULT { audioPath: 'output.wav',
parts:
[ { duration: 2.341688,
sentence: 'There once was a young lady named bright',
timestamp: 0 },
{ duration: 2.406938,
sentence: 'Whose speed was much faster than light',
timestamp: 2.841688 },
{ duration: 1.473625,
sentence: 'She set out one day',
timestamp: 5.748626 },
{ duration: 1.162188,
sentence: 'In a relative way',
timestamp: 7.722251 },
{ duration: 2.002438,
sentence: 'And returned on the previous night.',
timestamp: 9.384439 } ] }
```