No description
Find a file
2025-11-22 17:43:58 +01:00
.vscode better comments 2025-11-13 21:49:59 +01:00
examples change examples 2025-11-12 21:23:21 +01:00
Hardware Add KiCad Hardware files 2025-10-29 14:58:43 +01:00
src correct beep 2025-11-22 17:43:58 +01:00
.gitignore initial commit 2025-08-20 11:49:07 +02:00
index.html translate index.html to english 2025-11-20 19:29:47 +01:00
platformio.ini Delete uploader and add async webserver to serve files on sd card on own wifi host 2025-11-13 16:38:05 +01:00
README.md update readme 2025-11-13 21:51:12 +01:00

Audio Guestbook

Overview

There is the option to use the project with either an ESP32A1S or a Teensy40 equipped with an audio shield.

Dependencies

esp32a1s

Warning: The onboard microphones on the ESP32A1S cannot be disabled via software. They must be physically disabled (e.g., with hot glue).

teensy

Audio Shield

Configuration file

You can use a local configuration file on SD Card "/config.json"

teensy uses wav files esp32a1s only users mp3 files

{
  "useSD": true,
  "deleteInitialRecordings": true,
  "onlyLoop": false,
  "recordDirPath": "/recordings",
  "audioFileName": "/message.mp3", // for teensy use .wav
  "playbackVolume": 0.8,
  "beepVolume": 0.8,
  "recordDuration": 12000, // ms
  "playBusyFirst": 5000, // ms
  "beepDuration": 500, // ms
  "ringDuration": 60000, // ms
  "ringAfterDuration": 3600000, // ms
  "countFilePath": "/call_counts.json",

  // only for teensy
  "recordWav": true, // save raw audio files with wav header

  // only for esp32a1s
  "deepSleepAfterDuration": 5000, // ms

  "wifiSsid": "MyNetwork",
  "wifiPassword": "MyPassword"
}

⚠️ Deepsleep support is experimental enable only for testing

teensy

prepare wav files

Only 16 bit PCM, 44100 Hz WAV files are supported. When mono files are played, both output ports transmit a copy of the single sound. Of course, stereo WAV files play with the left channel on port 0 and the right channel on port 1.

ffmpeg -i input.ext -acodec pcm_s16le -ac 2 -channel_layout stereo -ar 44100 output.wav

The following two projects were used as templates:

esp32a1s

prepare mp3 files

ffmpeg -i input.ext -ar 44100 -ac 2 -b:a 96k -c:a libmp3lame -compression_level 2 output.mp3

WiFi

If wifiSsid and wifiPassword are defined, the device starts its own WiFi Access Point to serve the files on sd card.

Rotary Dial

  • If a number is dialed during the initial busy tone, the corresponding file is searched for in the /phone/ folder.
    Example: Number1312 → /phone/1312.wav is played.
    If the file 1312.wav is not found, the default file is played.

Pulse signal for rotary dial:

  • Yellow and green wires. A pulse signal occurs every100ms.
  • When dialing, brown and white are connected. During idle the brown and white lines are open. Each pulse closes the brownwhite pair for ~100ms, producing the pulse train

Handset lifted:

  • Black/white and yellow have a connection.

Procedure and Useful Examples

Recording examples

Input mixer and effects

Notes

The ESP32A1S module uses the ES8388 audio codec.
The two “LINEIN” pins (LINEINR and LINEINL) are the linein inputs of the codec and expect the typical analog audio linelevel signal—that is, not a microphone signal but a linelevel signal.

What does this mean in practice?

Feature Typical Value / Expectation
Voltage level 0.5VRMS (~1Vpeaktopeak); up to about2Vpp is still acceptable for the ES8388.
Signal type Singleended (singleended); the codec provides a small internal bias so the signal is centered around 0V (ground).
Impedance Input impedance ≈10kΩ (typical for linein stages).
Coupling ACcoupled (capacitor at the input), so a DC offset from the source device is not an issue.
Frequency range Approximately20Hz20kHz (the audio bandwidth of the ES8388).

In short: the LINEIN port expects a standard audio linelevel signal (as you would get from a CD player, a mixer output, or another amplifier output). A microphone signal would be too weak; a very strong speakerlevel signal (≥5Vpp) could overload the input.

If you want to connect the module to an external audio source, make sure the output signal falls within the voltage range mentioned above and, if necessary, ACcouple it with a capacitor (e.g.,10µF) to block any DC components.