Audio programming
Processing audio libraries
- Sound library
- Look for “Oscillators” to generate synthetic sounds
- Tutorial
Processing examples of Text-to-speech (TTS)
These code executes the system command on your OS. Windows and Mac both have their own implementation of speech-to-text:
Processing examples of audio input
- Download code (.zip)
- volume & pitch detection + speech recognition (using Python vosk and bridge to Processing through OSC protocol)
- Requirement:
- Python packages:
pip install sounddevice vosk python-osc - Processing library:
oscP5
- Python packages:
- References
- Python VOSK Offline Speech Recognition API
- Pitch detection in Processing: FFT analyze(), or PitchDetector
Processing audio troubleshooting
There’s a noise when I play a sound (sounds like double-beep)
This seems to be a bug in Processing when triggering the sound card in the computer for the first time. Play a sound (any sound) in setup first can resolve it.
The beep I made sound choppy
Use an envelope so the sound would fade in and out. See function env.
Error containing “… 16 bits, 411000Hz… “ and no sound can be played through Processing
Turn on the permission of microphone in the OS, or change the sound card properties to 16 bits 44100Hz.