Skip to content

About

Push-to-talk voice control for a NAO robot using OpenAI for chat and transcription.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

NAO Voice Control

NAO Voice Control is a Python push-to-talk voice interface for a SoftBank NAO robot. It records audio from your computer's microphone, transcribes it with OpenAI, maps common robot-control phrases to NAO actions, and sends everything else to a conversational model for spoken replies.

What It Does

  • Toggle push-to-talk with the Enter key
  • Turn on NAO sound awareness so the robot faces nearby sound
  • Speak responses with ALAnimatedSpeech gestures
  • Auto-wave on greetings and farewells
  • Execute built-in voice commands without sending them to the chat model

Requirements

  • Python 3
  • A microphone connected to the computer running the script
  • A reachable NAO robot with SSH access
  • qicli available on the robot over SSH
  • An OpenAI API key

Mac Setup

Install Python dependencies:

pip3 install openai sounddevice soundfile numpy

If soundfile complains about missing native libraries:

brew install libsndfile

Configuration

Open nao_voice_ptt.py and set:

  • OPENAI_API_KEY to your OpenAI API key
  • SYSTEM_PROMPT if you want different robot personality or behavior
  • CHAT_MODEL and TRANSCRIBE_MODEL if you want to swap models

Usage

Run with the robot hostname:

python3 nao_voice_ptt.py nao

Or run with the robot IP:

python3 nao_voice_ptt.py 192.168.1.102

Controls

  • Press Enter to start listening
  • Press Enter again to stop recording and send audio
  • Type q then press Enter to quit

Built-In Voice Commands

These commands are handled directly in the script:

  • stand up
  • sit down or crouch
  • wake up
  • rest, sleep, or relax
  • open left hand
  • open right hand
  • close left hand
  • close right hand
  • look left
  • look right
  • look up
  • look down
  • wave

If the spoken input does not match one of these patterns, the script sends the conversation to OpenAI chat and speaks the reply back through NAO.

How It Works

  1. Audio is recorded locally at 16 kHz.
  2. The WAV file is transcribed with gpt-4o-transcribe.
  3. Known robot-control phrases are matched and executed through qicli over SSH.
  4. Other requests are sent to gpt-4o-mini.
  5. The robot speaks the response with animated speech and gesture support.

Notes

  • The script currently expects the API key to be stored directly in the source file.
  • Greeting-like replies may trigger an automatic wave.
  • Test movement commands in a safe space before using them around people or obstacles.

About

Push-to-talk voice control for a NAO robot using OpenAI for chat and transcription.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages