Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/692fcfd8-4b44-800f-a184-fa098175a6d5
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== 我也幫你產生了一支可以自己在電腦上跑、產生 MP3 語音的腳本: ==== 👉 下載 generate_audio_gtts.py<ref>{{cite web|title=下載 generate_audio_gtts.py|url=https://chatgpt.com/share/%E4%B8%8B%E8%BC%89%20generate_audio_gtts.py|publisher=下載 generate_audio_gtts.py|access-date=2025-12-05}}</ref> 裡面會自動產生: * audio/zh_1.mp3 ~ zh_10.mp3(國語一~十) * audio/tai_1.mp3 ~ tai_10.mp3(用國語 TTS 念出「台語 it / nn̄g / saⁿ…」字樣,之後你可以用自己錄音或更好的台語 TTS 覆蓋) 使用方式(在你自己的電腦上): # 安裝 gTTS: ``<code>bash pip install gTTS <syntaxhighlight>2. 把 generate_audio_gtts.py 放在你專案資料夾中(跟 1~10.py 同一層即可) # 執行: </syntaxhighlight>bash python generate_audio_gtts.py <syntaxhighlight>4. 會自動建立 audio 資料夾,裡面就會有 zh_''.mp3 和 tai_''.mp3 ==== 你的 1~10.py 裡面原本就有這段邏輯: ==== * 讀取 gestures/{number}.png * 播放 audio/zh_{number}.mp3 和 audio/tai_{number}.mp3 你現在只要: # 確認結構長這樣: </syntaxhighlight>text 專案資料夾/ │ 1~10.py │ generate_audio_gtts.py ├─gestures/ │ 1.png │ ... │ 10.png └─audio/ zh_1.mp3 ... zh_10.mp3 tai_1.mp3 ... tai_10.mp3 </code>`` # 然後執行你的 1~10.py 就可以看到: - 左邊是攝影機畫面 + 偵測框、手勢數字 - 右邊是教學面板(顯示你剛剛的手勢圖片 1~10) - 每次換一個數字,會自動念國語 + 台語(暫以 gTTS 方式) 如果你待會跑程式又遇到錯誤(路徑、編碼、TTS、pygame 播放等),你可以直接把錯誤訊息貼給我,我幫你一條一條修。
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)