acoustic-model-machine
v1.0.2
Published
generate Custom Speech Service acoustic model datasets from audio and matching subtitles
Downloads
6
Maintainers
Readme
Acoustic Model Machine
This package can help you put together a dataset for training a custom acoustic adaptation model for Microsoft's Custom Speech Service.
It does so by using a video / audio file with matching subtitles to extract short passages of speech. These passages are saved to disk in the correct audio format needed. It'll then generate a transcription text file in the exact format required by Custom Speech Service. See the official Custom Speech Service documentation for more details on acoustic adaptation model datasets.
My favourite captioning service to request subtitle files from is Rev; I highly recommend their amazing people to caption your content!
Installation
Firstly, install NodeJS on your operating system.
You'll also need to have ffmpeg installed. Windows can be tricky in particular; this guide is a good one.
Then, in your favourite terminal application, type the following:
npm install -g acoustic-model-machine
Usage
acoustic-model-machine --source=/path/to/audio.wav --subtitle=/path/to/subtitle.srt --output-dir=mydatasetdir
Options
--source
required - the path to the source file containing the speech you want to extract.--subtitle
required - the path to the subtitle file that matches the source audio file. Requires .srt format.--output-dir
optional - the path to where you'd like the dataset saved to. Default is the current working directory.--output-prefix
optional - a custom prefix for the audio extraction files. Default isspeech
. See below section for output example.--verbose
optional - see more verbose logging output when generating a dataset.
Output
The completed dataset output will have the following structure:
mydatasetdir/
├── audio
│ ├── speech000001.wav
│ ├── speech000002.wav
│ ├── speech000003.wav
│ ├── speech000004.wav
│ ├── speech000005.wav
│ ├── speech000006.wav
│ ├── speech000007.wav
│ ├── speech000008.wav
│ ├── speech000009.wav
│ └── speech000010.wav
└── transcription.txt
Importing the acoustic adaptation dataset into Custom Speech Service
- Compress all audio files in the dataset into a flat zip file.
- Follow the official documentation to import.
Roadmap
- Importing of subtitles directly embedded in the source. For now, this needs to be performed manually with ffmpeg before using this tool.
- Notice anything else missing? File an issue :smile:
License
MIT.