TLDR: Add hands-free voice control to recipe apps in Python using on-device speech processing for cooking commands. Unlike cloud-based speech recognition that transcribes everything, this approach can directly understand specific commands ("set timer," "next step," "how much salt") with up to 8x fewer command recognition errors than big-tech cloud alternatives.
This tutorial demonstrates how to build hands-free voice control for recipe apps in Python using speech-to-intent processing that directly maps spoken commands to structured data without transcription. The implementation uses Rhino Speech-to-Intent to recognize cooking-specific commands defined in a configuration file, which can provide 97% command recognition accuracy in noisy environments.
Traditional cloud-based speech-to-text approaches transcribe every utterance into text before extracting meaning. This two-step pipeline introduces 200-500ms of latency and struggles in noisy kitchen environments where general models aren't optimized for background sounds like mixers and ventilation fans. Speech-to-intent eliminates the transcription step by directly understanding predefined commands, reducing latency and improving accuracy for command-based interactions.
What You'll Build
A Python voice control system for recipe apps that recognizes cooking-specific voice commands:
- Timer control: "Set timer for 10 minutes," "How much time is left"
- Recipe navigation: "Next step," "Repeat that"
- Ingredient queries: "How much salt do I need"
Requirements
- Python 3.9+
- Microphone (built-in or USB)
- Picovoice Console account
Estimated time: ~15 minutes
Step 1: Create Custom Voice Commands for Recipe App
- To train a custom Speech-to-Intent model, create an account on the Picovoice Console.
- Create an empty Rhino Speech-to-Intent context.
- Click the "Import YAML" button in the top-right corner of the Console. Paste the YAML provided below to add the intents and expressions for the voice controlled cooking app.
- Use the microphone button to test the context in-browser. This will save and build the context.
- Download the context file for your platform.
YAML Context file for the Voice Controlled Cooking App:
For more details on how to build your context, refer to the Rhino Syntax Cheat Sheet.
Step 2: Set Up Python Environment for Voice Control
Install the Rhino Speech-to-Intent Python SDK pvrhino to run inference, and the Picovoice Python Recorder library pvrecorder to capture microphone audio.
Step 3: Build Voice Control Workflow for Recipe Apps
Now let's run Rhino Speech-to-Intent with live audio and process voice commands in real time.
Initialize Model and Audio Input
The main function initializes Rhino with the ACCESS_KEY and context file, then sets up the audio recorder to capture microphone input.
Process User Voice Commands
Rhino continuously processes audio frames from the microphone. When a voice command is finalized, the cooking guide displays the recognized intent and executes the corresponding action.
Map Recognized Voice Commands to Cooking App Actions
Once Rhino finalizes an utterance, it produces an inference containing the recognized intent and slots. The process_inference function displays what was understood and triggers the corresponding action in the recipe app.
The handle_cooking_action function maps Rhino's recognized intents and their slots into recipe-specific actions.
Complete Python Script for Hands-Free Cooking App
Here's the complete Python script integrating all the components above:
Run Recipe App with Voice Commands
Run the script from your terminal with the following commands. Copy your AccessKey from the Picovoice Console and replace the placeholder values with your actual ACCESS_KEY and CONTEXT_FILE_PATH. The AUDIO_DEVICE_INDEX is optional and will use the default microphone if not specified.
The cooking app is now ready and listening for your voice commands.
Building a complete kitchen assistant with wake word detection and voice responses? See the voice-controlled kitchen appliances tutorial
Get Started
Ready to add voice control to your recipe app? Create your custom intent model for free in the Picovoice Console.
Start Free






