Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 2.87 KB

readme.adoc

File metadata and controls

59 lines (41 loc) · 2.87 KB

Project Guestlist

This project is built to run on raspberryPi on rasberryPi 3B+. It is designed to interface with a disemboweled rotory phone, where the handset is terminated into retrofit mono 3.5mm audio jack and connected to a headphone/mic usb adapter, a SPDT switch is interfaced with a GPIO 3.3v pin, a I/O pin to detect when the handset is lifted, and a ground.

This project can be expaned on to utilize the rotor for other purposes, but this specific application is as follows:

  1. Let a user lift the handset off the rest and wait 2 seconds (to put the speaker to their ear)

  2. Play a brief message instructing the user to leave a message

  3. Record the message from the user until the handset is returned to the receiver or 120 seconds (2 minutes) pass

  4. Save recording to the recordings folder

After the message is recorded, it will be saved to the folder with a timestamped title.

The preamble (section of audio that plays before recording the message) is a blocking audio clip, so the program will not continue until it’s finished.

Recording is non-blocking, meaning that the program will continue while recording is taking place. This is important because at any point, the handset can be set back on the reciever, or the timer can fire and reset the state.

Raspberry Pi Configuration and required dependencies:


The SPDT (single pole, dual throw) switch is powered through the common pole, the NC (normally closed) pole is wired to pin 18, and NO (normally open) is wired to pin 20 (GRND). This eliminates potential bad readings when the timer ends and sets the phone back into the 'lowered' state.

NOTES:

  • You will have to manually set your default audio i/o in Rasbian desktop. If you do not, you will not get any audio playback out of the jack, and the microphone may not record.

  • PyAudio dumps a bunch of messages in the console when its methods are used. Most are for adapters and cards not found on a rasberryPi. To disable: nano /usr/share/alsa/alsa.conf, find the seciton 'redirect to load-on-demand extended pcm definitions' and place a # infront of every line below pcm.sysdefault cards.pcm.default and above the next section. There will still be some messages, but this will remove the wall of errors.

  • 1kOhm resistors were used on the NC and NO legs of the switch, this may not be necessary as the GPIO pins have internal resistors. ''''

Required dependencies can be automatically installed with make depends command. PyAudio is required for recording. It requires libportaudio2, libportaudiocpp0, and portaudio19-dev. pydub is required for audio playback.

Make commands:


  • make depends: sudo installs the dependencies for PyAudio, pip3 installs PyAudio and pydub

  • make clean: removes pycache and any audio recordings in the /recordings dir

  • make run: runs guestListApp.py, press enter or terminate to close