![]() ![]() lower () if 'turn on the light' in text : board. info ( 'You said: " %s "' % text ) text = text. info ( 'You said nothing.' ) continue logging. language, hint_phrases = hints ) if text is None : logging. language ) client = CloudSpeechClient () with Board () as board : while True : if hints : logging. add_argument ( '-language', default = locale_language ()) args = parser. ArgumentParser ( description = 'Assistant service example.' ) parser. getdefaultlocale () return language def main (): logging. ![]() startswith ( 'en_' ): return ( 'turn on the light', 'turn off the light', 'blink the light', 'goodbye', 'repeat after me' ) return None def locale_language (): language, _ = locale. """A demo of the Google CloudSpeech recognizer.""" import argparse import locale import logging from aiy.board import Board, Led from aiy.cloudspeech import CloudSpeechClient import def get_hints ( language_code ): if language_code. Move your credentials.json file to the correct folder by entering the following: The file name contains your project name and some numbers: locate it rename it to cloud_speech.json Your credentials will download automatically.Enter a name so that you’ll know this is for your voice recognizer stuff, like “Voice credentials”.From the “Service account” dropdown, click New service account.Click Create credentials and then click Service account key from the list.Go to the left-hand navigation menu, click APIs & Services and then click Credentials.Enter “Cloud Speech API” into the search bar, then click the name.In the console, open the navigation menu and click APIs & Services.To connect or change the billing account, click the three-dot button, then select Change billing account.Make sure it’s connected to a billing account. Return to the main billing page, then click the My projects tab.If you don’t have a billing account, then click New billing account and go through the setup.In the Cloud Console, open the navigation menu.Don’t worry: you’ll get a reminder if you go over your free limit. Beyond that, the cost is $0.006 for every 15 seconds. If you use it for less than 60 minutes a month, it’s free. The Google Cloud Speech-to-Text service is a cloud-based service. You can also browse the examples on GitHub, where you'll find the source code for all the examples and more.įor instance, to learn more about the API, try running the voice_recorder.py example: These files are already installed on your kit at ~/AIY-projects-python/src/examples/. You might find it easier learn the aiy Python API if you start with an existing demo and modify it to do what you want. Pin definitions for the bonnet's extra GPIO pins, for use with gpiozero. In particular, the following APIs will be of interest for use with your Voice Kit:ĪPIs that simplify interaction with the Google Cloud Speech-to-Text service.Īn API that performs text-to-speech (reads some text aloud).ĪPIs to use the button that’s attached to the Voice Bonnet’s button connector. To learn more about these APIs, refer to the API reference. Just be sure that you've installed the latest system image. These APIs are built into a Python package named aiy, which is pre-installed in the kit's system image. It makes it easy to interact with services like Google Assistant and Cloud Speech-to-Text, and to use kit peripherals such as the button, LEDs, and extra GPIO pins. To support various features in the Voice Kit, we've built a Python library that handles a lot of programming dirty work for you. You can then use a keyboard/mouse combo that requires only one USB port.Īdapter option B: Micro USB Hub that provides multiple USB ports to connect to any traditional keyboard and mouse. Below are two different options.Īdapter option A: USB On-the-go (OTG) adapter cable to convert the Raspberry Pi USB micro port to a normal-sized USB port. Adapter to attach your mouse and keyboard to the kit.Normal-sized HDMI cable and mini HDMI adapter.Monitor or TV (any size will work) with a HDMI input.Option 2: Use a monitor, mouse, and keyboardĬhoose this option if you don’t have access to an Android smartphone. Option 1: Use the AIY Projects appĬhoose this option if you have access to an Android smartphone and a separate computer. It will not be able to provide enough power and it may corrupt the SD card, causing boot failures or other errors.īelow are two different options to connect to your kit to Wi-Fi, so that you can communicate with it wirelessly. Don't try to power your Raspberry Pi from your computer. The second-best choice is to use a phone charger that also provides 2.1A of power (sometimes called a fast charger). Micro USB power supply: The best option is to use a USB Power supply that can provide 2.1 Amps of power via micro-USB B connector.2mm flat screwdriver: For tightening the screw terminals.You’ll need some additional things, not included with your kit, to build it: ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |