制造商零件编号 DFR0706-EN
UNIHIKER IOT PROGRAMMING SBC
DFRobot
所订产品一般在 7-10个工作日 内送达中国,具体时间取决于收货地点。
最低订购金额为人民币 300 元,顺丰快递免运费配送。
当用人民币下单时,按照国际贸易条款 DDP(DigiKey 支付关税、海关费用和当地税款)方式结算。
电汇预付
更多来自全授权合作伙伴的产品
下单后,从合作伙伴发货平均需要时间 1-3 天,也可能产生额外运费。可能另外收取运费。 实际发货时间请留意产品详情页、购物车和结账页面上的说明。
国际贸易结算方式:CPT(交货时支付关税、海关费用和适用 VAT/应付税金)
有关详情,请访问帮助和支持
License: Attribution Non-Commercial No Derivatives Single Board Computers
UNIHIKER is a single-board computer(SBC) that features a 2.8-inch touchscreen, Wi-Fi and Bluetooth. It is equipped with a light sensor, accelerometer, gyroscope, and microphone. With a built-in co-processor, it is able to communicate with various analog/digital/I2C/UART/SPI sensors and actuators.
UNIHIKER has speech recognition, speech synthesis, Wi-Fi, and other functions. Therefore, it can be used for speech recognition and speech synthesis projects.
I have shared the Azure method I often use to make UNIHIKER an intelligent conversation assistant.
Official website link: https://azure.microsoft.com/en-us
Step 1: Account Login
Login with GitHub account
Login with email address
Login with phone or Skype
Click Next to complete the login
Step 2: Create resources
Step 3: Set parameters
Basics create
Subscription-> Default selection
Resource group-> Create a new resource group
Region-> Select according to your region
Create a new project name
Pricing tier-> Depending on your choice of pricing
Then select Next.
Network selection
Then select Next.
Identity selection
Open or close according to your needs
Then select Next.
Tags choice
Default empty
Then select Next
Review + create
Review + Create
Then select Create.
Creation complete
Click on GO to resource
Get the key and Location/Region
Click the arrow to get the key and Location/Region
The Unihiker uses Azure services
Installation:
Before installation, ensure that UNIHIKER is connected to Wi-Fi. For details, see the official documentation of UNIHIKER.
CODE
pip install azure.cognitiveservices.speech
import time
import os
from azure.cognitiveservices.speech import SpeechConfig
AZURE_SPEECH_KEY = "" # Fill key
AZURE_SPEECH_REGION = "" # Enter Location/Region
try:
import azure.cognitiveservices.speech as speechsdk
except ImportError:
print("""
Importing the Speech SDK for Python failed.
Refer to
https://docs.microsoft.com/azure/cognitive-services/speech-service/quickstart-python for
installation instructions.
""")
import sys
sys.exit(1)
# Set up the subscription info for the Speech Service:
# Replace with your own subscription key and service region (e.g., "japaneast").
speech_key, service_region = AZURE_SPEECH_KEY, AZURE_SPEECH_REGION
def tts(text):
speech_config = SpeechConfig(subscription=speech_key, region=service_region)
speech_config.speech_synthesis_language = "en-US"
speech_config.speech_synthesis_voice_name ="en-US-JennyNeural"
# Creates a speech synthesizer for the specified language,
# using the default speaker as audio output.
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config)
# Receives a text from console input and synthesizes it to speaker.
result = speech_synthesizer.speak_text_async(text).get()
def speech_recognize_once_from_mic():
speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region, speech_recognition_language="en-US")
audio_config = speechsdk.audio.AudioConfig(use_default_microphone=True)
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
print("Speak into your microphone.")
speech_recognition_result = speech_recognizer.recognize_once_async().get()
if speech_recognition_result.reason == speechsdk.ResultReason.RecognizedSpeech:
print("Recognized: {}".format(speech_recognition_result.text))
elif speech_recognition_result.reason == speechsdk.ResultReason.NoMatch:
print("No speech could be recognized: {}".format(speech_recognition_result.no_match_details))
elif speech_recognition_result.reason == speechsdk.ResultReason.Canceled:
cancellation_details = speech_recognition_result.cancellation_details
print("Speech Recognition canceled: {}".format(cancellation_details.reason))
if cancellation_details.reason == speechsdk.CancellationReason.Error:
print("Error details: {}".format(cancellation_details.error_details))
print("Did you set the speech resource key and region values?")
tts(speech_recognition_result.text)
while True:
speech_recognize_once_from_mic()
谢谢!
敬请关注收件箱中的 DigiKey 新闻与更新!
请输入电子邮件地址