speech aligner
1.0.0
speech-aligner,是一個從“人聲語音”及其“語言文本”,產生音素級別時間對齊標註的工具。
# 调用 bin,输入语音列表和文本、输出对齐结果
cd egs/cn_phn
speech-aligner --config=conf/align.conf data/wav.scp data/text data/out.ali
# 查看输出对齐结果,包含: 文件名,音素时间起点(秒) 音素时间终点(秒) 音素
cat data/text data/out.ali
BAC009S0002W0122 而对楼市成交抑制作用最大的限购
BAC009S0002W0122
0.000 0.535 sil
0.535 0.540 $0
0.540 0.745 er_2
0.745 0.850 d
0.850 0.895 ui_4
0.895 1.305 l
1.305 1.435 ou_2
...
4.955 5.055 x
5.055 5.525 ian_4
5.525 5.745 g
5.745 5.930 ou_4
5.930 5.975 sil
.預先準備:
cmake >= 3.1
有如下blas接口數學庫之一:
建議:mkl
conda install mkl (mkl默認會隨conda一起安裝)conda可執行( which conda有輸出)atlas
ubuntu安裝: sudo apt-get install libatlas3-base
linux發行版眾多,數學庫路徑不一且變動,所以可以通過如下命令進行路徑指定:
cmake -DBLAS_VENDORS=ATLAS -DBLAS_ATLAS_LIB_DIRS=[/path/to/atlas/lib ..OSX系統(Darwin)自帶Accelerate framework,可調過這項
…其他數學庫,可查看cmake/Modules/FindBLAS.cmake ,了解支持的數學庫
cmake編譯
git clone .../speech-aligner.git
cd speech-aligner
mkdir build && cd build
cmake ..
make -j編譯結果
--config=egs/cn_phn/conf/align.confspeech-aligner, is a tool that generate phoneme-level alignment between human speech and its transcription
# call the bin,with speech and transcript as inputs
./bin/speech-aligner --config=egs/cn_phn/conf/align.conf egs/cn_phn/data/wav.scp egs/cn_phn/data/text egs/cn_phn/data/out.ali
# check the output alignment, include: filename, phoneme and its start/end time
cat egs/cn_phn/data/text egs/cn_phn/data/out.ali
BAC009S0002W0123
0.000 0.025 y
0.025 0.460 e_3
0.460 0.850 sil
0.850 0.985 ch
0.985 1.095 eng_2
...
2.655 2.735 zh
2.735 2.900 ong_1
2.900 2.960 d
2.960 3.665 ing_1
3.665 3.845 sil
.requirements
cmake >= 3.1
one of blas math lib:
mkl (recommended)
conda install mkl (mkl is installed with conda by default)conda should be in your pathatlas
ubuntu: sudo apt-get install libatlas3-base
when cmake, it maynot find your atlas automatically, thus you need set the math lib path as below:
cmake -DBLAS_VENDORS=ATLAS -DBLAS_ATLAS_LIB_DIRS=[/path/to/atlas/lib ..Accelerate framework (need do nothing for "macOS/Darwin")
...
cmake
git clone .../speech-aligner.git
cd speech-aligner
mkdir build && cd build
cmake ..
make -jresults