Audio guestbook using an old rotary phone and a raspberry pi zero
Go to file
Craig Hesling 0c43bba31c
Merge develop branch into main (#1)
* refactor: functional

* refactor: ♻️ move alsa_hw_mapping to config param

---------

Co-authored-by: Nick Pourazima <nick.pourazima@gmail.com>
2023-02-07 20:59:02 -05:00
images Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
sounds Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
todo Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
.gitignore Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
audioGuestBook.py Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
audioGuestBook.service Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
audioInterface.py Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
config.yaml Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
LICENSE Initial commit 2022-07-22 13:04:14 -04:00
README.md Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00
requirements.txt Merge develop branch into main (#1) 2023-02-07 20:59:02 -05:00

Rotary Phone Audio Guestbook

This project transforms a rotary phone into a voice recorder for use at special events (i.e. wedding audio guestbook, etc.).

Background

I was inspired by my own upcoming wedding to put together a DIY solution for an audio guestbook using a rotary phone. Most online rentals were charging $600 for an experience that didn't even offer the ability to add a custom voice mail and took about 4-6 weeks of turn around time to process the audio after the event. I tried to use as many parts that I had laying around to keep costs down. It worked out quite well and we were able to gather some very special voice messages.

Below you will find a parts list and detailed setup guide. Please feel free to reach out to me with any questions.

Post-Event

Since this was a trial by fire type of scenario there ended up being a few gotchas at the real event which I've since accounted for. Namely setting a time limit on the recording length as we had some youngsters leaving 5+ minute messages repeatedly and this ended up draining the battery.

Future Potential

A few weeks before the wedding I had the code registering dialed numbers from the rotary encoder with the goal of playing back special messages for certain guests who dialed a certain combination (i.e. dial an area code to hear a special message to my old roomates). The details of this operation mode are described in Mode 2 below. In order to activate this mode I had to wait for input when the phone was off the hook. This required an extra step of dialing zero before leaving a normal voice message. In the end we decided to keep it simple and I've thus migrated this code to the dev branch along with the code to run through post-porcessing the audio in a separate process. If any one is interested in expanding this please feel free.

Materials

Part Notes Quantity Cost
rotary phone Estate/garage/yard sales are probably the best places to find once of these. Ideally one with a phone jack since we will be using these four wires extensively. 1 $0.00-$60.00
raspberry pi zero I didn't realize how hard these are to find these days. You can use any rpi or arduino style single-board computer but be aware of size constraints (i.e. must fit inside the rotary phone enclosure) 1 $9.99
raspberry pi zero case Optional: added for protection. One of the cases on Amazon has a heat-sink cutout which might be nice for better heat dissapation since it will all be enclosed in the end. 1 $4.95
micro SD card Any high capacity/throughput micro SD card that is rpi compatible 1 $8.99
USB Audio Adapter Note: I removed the external plastic shell and directly soldered the wires instead of using the female 3.5mm receptacle. 1 $4.95
USB OTG Host Cable - MicroB OTG male to A female 1 $2.50
--- --- If running off a battery --- --- ---
LiPo Battery Optional: maximize capacity based on what will fit within your rotary enclosure. 1 $12.50
LiPo Shim Optional: if you plan to run this off a LiPo I would recommend something like this to interface with the rpi zero. 1 $9.95
LiPo Charger Optional: for re-charging the LiPo. 1 $6.95
--- --- If replacing the built-it microphone --- --- ---
LavMic Optional: if you'd like to replace the carbon microphone. This is an omnidirectional lavalier mic and outputs via a 3.5mm TRS 1 $24.95

Setup

Hardware

Wiring

Microphone Replacement (Optional)

I found the sound quality of the built-in carbon microphone on the rotary phone to be quite lacking in terms of amplitude, dynamic range and overall vocal quality. I tried boosting the gain from the digital (ALSA driver) side but this introduced an incredible amount of noise as expected. I then approached this from the analog domain and tried alternative circuitry to boost the sound quality based off this carbon-to-dynamic converter.

Might be worth a further investigation in the future since it retains the integrity of the original rotary phone.

My final attempt involved the introduction of some post-proceesing (see dev branch) to bandpass some of the freqs outside the speech domain and add some normalization. The processing was costly in terms of processing and power consumption/rendering time and I ultimately decided it was worth acquiring something that yielded a better capture right out the gate. Crap in, crap out - as they say in the sound recording industry.

To replace:

  • Unscrew mouthpiece and remove the carbon mic
  • Pop out the plastic terminal housing with the two metal leads
  • Unscrew red and black wires from terminal

image

Software

Dev Environment

  • rpi image: Rasbian w/ SSH enabled
  • rpi on same network as development machine
  • Desktop IDE: vscode w/ SSH FS extension

Here's a great guide to get the rpi setup headless w/ SSH & WiFi dialed in.

Dependencies

AudioInterface Class

rotaryGuestBook.service

This service starts the python script on boot. Place it in the /etc/systemd/system directory.

systemctl enable audioGuestBook.service systemctl start audioGuestBook.service

Operation Mode 1: rotaryGuestBook

Operation Mode 2: rotaryGuestBookwithRotaryDialer

Note: Untested - decided not to go this route for my own wedding

  • This mode is a special modification of the normal operation and requires a slightly different wiring connection since it accepts input from the rotary dialer.
  • The idea was to playback special messages when particular users dial a certain number combination (i.e. 909 would play back a message for certain guests who lived with the groom in that area code).
  • In this mode of operation the users will need to dial 0 on the rotary dialer in order to initiate the voicemail.