Conversation
This proof of concept is for implementing conversational loop with AI at a low level with raw C.
How it works
This simple program:
- Captures audio samples for x seconds into a local file using alsa
- Sends the raw pcm data to Deepgram STT API for transcription
- Uses the transcript to call Anthropic to get an assistant's response
- Converts Anthropic's response to audio using Deepgram's TTS
- Plays back the generated audio from Deepgram using alsa
- Quits. There is no conversational loop at the time of this writing.
Requirements
Platform: the project is meant for Linux, specifically Ubuntu desktop.
- libcurl
- build-essential
- libasound2-dev
See more deps in Makefile install-deps command.
Getting started
- Add
DEEPGRAM_API_KEYandANTHROPIC_API_KEYto.bashrcas environment variables. - Build & run
make
./main