In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use Python to achieve offline voice prompt, the article is very detailed, has a certain reference value, interested friends must read it!
Environment:
Win7 system, the external network is not connected, the host is connected to the listening speaker.
Prepare:
Voice synthesis is obviously used here, and since it is offline, it is certainly impossible to call interfaces such as Baidu AI. Installing an offline voice package is a bit exciting, so let's just use Microsoft's own Speech SDK. Note that many Ghost versions of systems may have removed this feature and need to be reinstalled. After learning online, we found that we only need to install the library pyttsx3.
Train of thought:
Put all the ringtones in a list. Then go through the list to find the next time to ring the bell at the current time. Then interpret the number of "minutes" of the difference (not accurate to seconds, just a rough reminder), and call the speech synthesis output.
Coding:
Import datetime,timeimport pyttsx3engine = pyttsx3.init () ringTimes= ["8:30", "9:00", "11:00", "14:00", "14:30", "15:30", "15:55", "16:20", "17 ringTimes= 20"] def alarmTime (): currTime=datetime.datetime.now () hmemery mpaper currcurrTime. CurrTime.second for t in ringTimes: t2=int (t.split (':) [0]) * 60+int (t.split (':) [1]) t1=h*60+m if T1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.