Coder Social home page Coder Social logo

telegraph's Introduction

TELEGRAPH project

Wikipedia link

About

Lets have a chat with ChatGPT4,

BUT for REAL,

Lets have a call.

We are best friends.

This script is using OpenAI STT, chat and TTS models, to have a real feeling chat.

Equipment:

  • Raspberry pi 3 B
  • USB headset (microsoft LiveChat)
  • Switch
  • 5 mm LED
  • 2 X 220 kOhm resistors
  • Old wireless telephone.

The process (Connecting the hardware):

telephone

  1. Taking apart an old DECT telephone.

telephone open 1

telephone open 2

  1. Disconnecting speaker

Speaker

  1. Soldering LED + resistors + switch to cable.

LED

Switch

  1. Disassemble USB headset:

Headset

  1. Testing cable on raspberry pi.

LED

  1. Soldering USB speaker and microphone wires to telephone, adhering the button to back cover with hot glue and adhering the LED to front cover with hot glue.

The connection

  1. Closing all together.

all together 1

all together 2

all together 3

Schematics

schematics

Behind the scenes:

  1. If there where old message files, they will be deleted from the folder.
  2. A pre recorded welcome message will play to the user.
  3. User press the button and record a new message.
  4. When releasing the button, the message converted to MP3 and sent to OpenAI Whisperer module - Speech To Text (STT).
  5. The replied transcript then sent to OpenAI ChatGPT 4 module.
  6. The replied generated text then sent to OpenAI Text To Speech module (TTS).
  7. The replied MP3 then converted to WAV and played back to the user.

Demo video

Install:

Install ffmpeg on machine:

https://ffmpeg.org/

git clone sdebby/telegraph
pip install -r requirements.txt
python ChatWithLinux1.py -d [x]

Obtain Open AI API key and save in in environment as "OpenAI_Key" (or replace the key in file OpenAIHelper.py)

Usage

parameters:

-h help

-l list of USB devices

-d [x] use USB device no. x

  • If using a Raspberry pi (like in this project) and need to adjust volume:
alsamixer
- Adjust USB device volume and exit
- Save configuration: 
sudo alsactl store

Limitations:

  • Due to the ping-pong method (sending voice,receiving text, sending text, ect ...) there is a long delay from when talking to receiving answer.

telegraph's People

Contributors

sdebby avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.