Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Mark Liu

Rating No ratings yet

A project-based book that teaches beginning Python programmers how to build working, useful, and fun voice-controlled applications. This fun, hands-on book will take your basic Python skills to the next level as you build voice-controlled apps to use in your daily life. Starting with a Python refresher and an introduction to speech-recognition/text-to-speech functionalities, you’ll soon ease into more advanced topics, like making your own modules and building working voice-controlled apps. Each chapter scaffolds multiple projects that allow you to see real results from your code at a manageable pace, while end-of-chapter exercises strengthen your understanding of new concepts. You’ll design interactive games, like Connect Four and Tic-Tac-Toe, and create intelligent computer opponents that talk and take commands; you’ll make a real-time language translator, and create voice-activated financial-market apps that track the stocks or cryptocurrencies you are interested in. Finally, you’ll load all of these features into the ultimate virtual personal assistant – a conversational VPA that tells jokes, reads the news, and gives you hands-free control of your email, browser, music player, desktop files, and more. Along the way, you’ll learn how to: • Build Python modules, implement animations, and integrate live data into an app • Use web-scraping skills for voice-controlling podcasts, videos, and web searches • Fine-tune the speech recognition to accept a variety of input • Associate regular tasks like opening files and accessing the web with speech commands • Integrate functionality from other programs into a single VPA with computational knowledge engines to answer almost any question Packed with cross-platform code examples to download, practice activities and exercises, and explainer images, you’ll quickly become proficient in Python coding in general and speech recognition/text to speech in particular.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that turns basic Python knowledge into working voice-controlled apps, from simple speech recognition to a full virtual personal assistant. Best for beginner-to-intermediate Python learners who want practical, fun projects rather than abstract theory. 【Book Arc】 - **Opening (~0%–10%)**: Sets up the toolkit — installing Python via Anaconda and Spyder, a Python refresher (syntax, data types, loops, functions, modules), and the book's project roadmap toward a virtual personal assistant. - **Early (~10%–35%)**: Builds the core voice pipeline — speech recognition with the SpeechRecognition module and text-to-speech across Windows, Mac, and Linux — then packages these into reusable custom modules. - **Middle (~35%–50%)**: Applies the voice pipeline to practical tools: a voice-controlled calculator, a real-time language translator, and voice-driven web scraping for podcasts, videos, and searches. - **Late (~50%–75%)**: Moves into interactive voice-controlled games — Tic-Tac-Toe, Connect Four, and a guess-the-word game — using turtle graphics, mouse-click handling, and animated game boards. - **Ending (~75%–100%)**: Assembles everything into a conversational virtual personal assistant that tells jokes, reads news, tracks financial markets, and gives hands-free control of email, browser, music, and desktop files. 【Key Takeaways】 - **The book is project-first, not theory-first** (Opening): Each chapter scaffolds multiple working projects with downloadable code, so you learn by building and seeing real results at a manageable pace. - **Speech recognition and text-to-speech are the twin foundations** (Early): The SpeechRecognition module (with `recognize_google()` as the primary engine) and text-to-speech libraries form the reusable core that every later project depends on. - **Custom modules make voice features portable** (Early): Wrapping recognition and speech into your own modules (like `mysr` and `mysay`) lets you import them across projects instead of rewriting boilerplate. - **Voice control extends to real-world tasks** (Middle): Web scraping, live data integration, and speech commands for opening files and accessing the web turn Python into a practical daily tool. - **Games teach event handling and animation** (Late): Tic-Tac-Toe and Connect Four demonstrate mouse-click-to-cell conversion, falling-disc animation, and win/tie detection — then layer voice control on top. - **The VPA is the capstone integration project** (Ending): It combines speech, web scraping, computational knowledge engines, and system control into one conversational assistant that answers almost any question. - **Cross-platform awareness matters** (Early): The book explicitly handles Windows, Mac, and Linux differences in text-to-speech and microphone setup, with warnings about selecting the right input device. 【Reading Tips】 - **Skim the Python refresher if you already code** (Opening): The syntax, data types, and module sections are a safety net for beginners; experienced readers can jump to the speech chapters. - **Deep-read the speech recognition and TTS chapters** (Early): These are the load-bearing walls — every later project imports from them, so understanding `adjust_for_ambient_noise()`, `recognize_google()`, and the module-wrapping pattern pays off repeatedly. - **Type the code, don't just read it**: The book is explicitly hands-on; the value comes from running scripts, hearing your own voice commands work, and debugging microphone issues in real time. - **Do the end-of-chapter exercises**: They reinforce new concepts and often extend the chapter's project in ways that prepare you for the next one. - **Treat the VPA chapter as a synthesis, not a standalone**: By the time you reach it, you should recognize the pieces — recognition, TTS, scraping, system control — being assembled into one program. 【Coverage Limits】 The excerpts cover the book's structure, early Python refresher, speech recognition/TTS setup, and the game chapters' table of contents, but do not include detailed content from the translator, financial-market, or VPA chapters beyond their descriptions.
Excerpt 1
mputational knowledge engines to answer almost any question Packed with cross-platform code examples to download, practice activities and exercises, and expl...
View in text
Excerpt 2
sing Anaconda and Spyder, so we’ll discuss the advantages of choosing this Python distribution and development environment, respectively. I’ll guide you thro...
View in text
Excerpt 3
e, we cannot use methods like append() or remove() on them. We cannot sort the elements in a tuple either. The elements of a tuple are indexed by integers, a...
View in text
Excerpt 4
rt print_say() from mysay. You also import voice_to_text() from the mysr module created in Chapter 3. You use voice_to_text() to con- vert your voice command...
View in text
Excerpt 5
e whitespace behind it with an empty string 3 so that your command “Play Selena Gomez” becomes Selena Gomez. The next command 106   Chapter 5 All tags start...
View in text
Excerpt 6
w().format('m') Building a Virtual Personal Assistant   141 Run vpa.py. You can set an alarm clock after waking up your VPA. The following output is from one...
View in text
Excerpt 7
r based on x and y values if -300<x<300 and -300<y<300: col = int((x+500)//200) row = int((y+500)//200) # The cell number is a string variable 3 cellnumber =...
View in text
Excerpt 8
if> = 0 in the function to ensure that we have no negative indexing anywhere. Finally, we use try and except in every one of the four cases of winning by con...
View in text
Tags
AI categories
PythonProgrammingArtificial Intelligence
ISBN: 1718501579
Publisher: No Starch Press
Publish Year: 2021
Language: English
Pages: 408
File Format: PDF
File Size: 7.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…