![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python 开发IEnglish
stripe-python
python3爱好者
展开
-
python 开发IEnglish (四) pysimplegui创建窗口
main.py:import PySimpleGUI as sgimport uuidimport playsoundimport randomfrom tkinter.messagebox import showinfofrom wordio import read_words, read_theme, write_themefrom speak import get_soundfrom recording import recordfrom compare import compare原创 2021-07-21 14:36:51 · 345 阅读 · 3 评论 -
python 开发IEnglish (三) 文件IO
新建wordio.pydef read_words(words_file): with open(words_file, 'r', encoding='utf-8') as fw: words = fw.read() result = [] for i in words.split('---'): i = i.strip() english, chinese = i.split('\n') result.append(原创 2021-07-21 14:33:37 · 134 阅读 · 0 评论 -
python 开发IEnglish (二) 录音
下载pyaudiopip install pyaudio如果不行请见这里创建recording.pyimport pyaudioimport waveclass recording: CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 8000def record(save_path, seconds=14): p = pyaudio.PyAudio() stream = p.原创 2021-07-21 13:29:52 · 149 阅读 · 1 评论 -
python 开发IEnglish (一) 生成语音与音频比较
创建trans.py 写入:from pydub import AudioSegment # pip install pydubdef mp3_to_wav(mp3_path, wav_path): # 转换mp3为wav song = AudioSegment.from_mp3(mp3_path) song.export(wav_path, format='wav') return wav_path创建speak.py 请见我写的python调用baidu-aip朗读原创 2021-07-21 13:17:06 · 502 阅读 · 0 评论