| .vscode | ||
| examples | ||
| Hardware | ||
| src | ||
| .gitignore | ||
| index.html | ||
| platformio.ini | ||
| README.md | ||
Audio Guestbook
Overview
There is the option to use the project with either an ESP32‑A1S or a Teensy 40 equipped with an audio shield.
Dependencies
esp32a1s
Warning: The onboard microphones on the ESP32‑A1S 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"
}
⚠️ Deep‑sleep 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
Wi‑Fi
If wifiSsid and wifiPassword are defined, the device starts its own Wi‑Fi 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: Number 1312 →/phone/1312.wavis played.
If the file1312.wavis not found, the default file is played.
Pulse signal for rotary dial:
- Yellow and green wires. A pulse signal occurs every 100 ms.
- When dialing, brown and white are connected. During idle the brown and white lines are open. Each pulse closes the brown‑white pair for ~100 ms, 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 ESP32‑A1S module uses the ES8388 audio codec.
The two “LINEIN” pins (LINEINR and LINEINL) are the line‑in inputs of the codec and expect the typical analog audio line‑level signal—that is, not a microphone signal but a line‑level signal.
What does this mean in practice?
| Feature | Typical Value / Expectation |
|---|---|
| Voltage level | ≈ 0.5 V RMS (~ 1 V peak‑to‑peak); up to about 2 V p‑p is still acceptable for the ES8388. |
| Signal type | Single‑ended (single‑ended); the codec provides a small internal bias so the signal is centered around 0 V (ground). |
| Impedance | Input impedance ≈ 10 kΩ (typical for line‑in stages). |
| Coupling | AC‑coupled (capacitor at the input), so a DC offset from the source device is not an issue. |
| Frequency range | Approximately 20 Hz – 20 kHz (the audio bandwidth of the ES8388). |
In short: the LINEIN port expects a standard audio line‑level 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 speaker‑level signal (≥ 5 V p‑p) 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, AC‑couple it with a capacitor (e.g., 10 µF) to block any DC components.