12345678910111213141516171819202122232425262728 |
- # !pip install librosa==0.7.2
- # !pip install numba==0.48.0
- # !pip install pydub
- import pandas as pd
- import numpy as np
- import re
- import jieba
- import jieba.posseg as pseg
- import urllib
- import urllib.request
- import librosa
- from pydub import AudioSegment
- from pydub.silence import split_on_silence
- import itertools
- from util import *
- if __name__ == '__main__':
- mp3_path='test1.mp3'
- ch_sentence = "資料分析是我的工作"
- download = False #如果要下載才需要Ture
- hakka_100 = import_hakka_100()
- word_data,multi_sound = import_data()
- if download:
- download_mp3(word_data,multi_sound)
- download_hakka_100(hakka_100)
- ch_word_list = list(itertools.chain(*word_data['華語詞義集'].tolist())) + hakka_100.chinese_clean.tolist()
- import_jieba_userdict(ch_word_list=ch_word_list, userDict_path='userDict.txt')
- gen_hakka_tts(word_data,multi_sound,hakka_100,ch_sentence,mp3_path)
|