Thursday, 11 February 2021

2021春晚


为民服务孺子牛,创新发展拓荒牛,艰苦·奋斗老黄牛,的三牛精神。

Tuesday, 9 February 2021

python speech ICAO Phonetic Alphabet


L/N* Word Pronunciation Morse
A Alpha AL FAH .-
B Bravo BRAH VOH -...
C Charlie CHAR LEE or SHAR LEE -.-.
D Delta DELL TAH -..
E Echo ECK OH .
F Foxtrot FOKS TROT ..-.
G Golf GOLF --.
H Hotel HOH TEL ....
I India IN DEE AH ..
J Juliett JEW LEE ETT .---
K Kilo KEY LOH -.-
L Lima LEE MAH .-..
M Mike MIKE --
N November NO VEM BER -.
O Oscar OSS CAH ---
P Papa PAH PAH .--.
Q Quebec KEH BECK --.-
R Romeo ROW ME OH .-.
S Sierra SEE AIR RAH ...
T Tango TANG GO -
U Uniform YOU NEE FORM or OO NEE FORM ..-
V Victor VIK TAH ...-
W Whiskey WISS KEY .--
X X-Ray ECKS RAY -..-
Y Yankee YANG KEY -.--
Z Zulu ZOO LOO --..
1 One WUN .----
2 Two TOO ..---
3 Three TREE ...--
4 Four FOW ER ....-
5 Five FIFE .....
6 Six SIX -....
7 Seven SEV EN --...
8 Eight AIT ---..
9 Nine NIN ER ----.
0 Zero ZE RO -----
. Decimal DAY SEE MAL
Hundred HUN DRED
Thousand TOU SAND

reference:

Peter Schiff

Sunday, 7 February 2021

Meat King of Dubai

Women Supercar Drivers Club

Renault Morphoz

python speech recognition + duckduckgo instant answer api

#ask a question through microphone
#computer translate to text, and query on duckduckgo
#computer receive response from duckduckgo and speaks result
PS C:\Users\bob\python-speech> python main.py
Ask me any question?
say something!
You said: Banff National Park
Banff National Park is Canada's oldest national park, established in 1885. Located in Alberta's Rocky Mountains, 110–180 kilometres west of Calgary, Banff encompasses 6,641 square kilometres of mountainous terrain, with many glaciers and ice fields, dense coniferous forest, and alpine landscapes. The Icefields Parkway extends from Lake Louise, connecting to Jasper National Park in the north. Provincial forests and Yoho National Park are neighbours to the west, while Kootenay National Park is located to the south and Kananaskis Country to the southeast. The main commercial centre of the park is the town of Banff, in the Bow River valley. The Canadian Pacific Railway was instrumental in Banff's early years, building the Banff Springs Hotel and Chateau Lake Louise, and attracting tourists through extensive advertising. In the early 20th century, roads were built in Banff, at times by war internees from World War I, and through Great Depression-era public works projects.

import time
import speech_recognition as sr
import pyttsx3
import requests
import json

def speak(audioString):
    print(audioString)

    engine = pyttsx3.init()
    engine.say(audioString)
    engine.runAndWait()

def recordAudio():
    r = sr.Recognizer()
    with sr.Microphone() as source:
        print("say something!")
        #r.adjust_for_ambient_noise(source)
        audio = r.listen(source)

        try:
            data = r.recognize_google(audio)
            print("You said: " + data)

        except sr.UnknownValueError:
            return "Couldn't understand audio"

        except sr.RequestError as e:
            return "couldn't request results; {0}" + format(e)

        return data


speak("Ask me any question?")

data = recordAudio()

res = requests.get("https://api.duckduckgo.com",
             params={"q": data,
                     "format": "json",
                     "pretty": "1"})

answer = json.loads( res.content)

reply = answer["Abstract"] + answer["Answer"]

speak(reply)
"""
if reply:
    speak(reply)
elif reply == "":
    speak("I did't find answer")
"""

reference:

duckduckgo instant answer api