sudo nano /boot/firmware/config.txt
# modify the config.txt
dtparam=audio=off
dtoverlay=iqaudio-dacplus
# save and quit
sudo reboot
#list dacs:
aplay -l
# select dac: iqaudio-dacplus
# hit f6 and select dac
alsamixer
# play sample sound
aplay /usr/share/sounds/alsa/Front_Center.wav
# install play command via sox
sudo apt install sox
play -n synth [seconds] [waveform] [frequency]
# play 1000hz sine for 5 seconds
play -n synth 5 sine 1000
# play 500hz sawtooth continuously
play -n synth 0 sawtooth 500
Mixing waveforms:
# Mix a 440Hz sine wave and a 660Hz sine wave for 5 seconds
sox -m -n synth 5 sine 440 -n synth 5 sine 660 -d
# sox: The main command.
# -m: Specifies mixing the inputs.
# -n: Creates a null input (needed for synth).
# synth 5 sine 440: Generates the first 5-second, 440Hz sine wave.
# -n synth 5 sine 660: Generates the second 5-second, 660Hz sine wave.
# -d: Sends the mixed output to the default audio device.
Waveform | Command |
---|---|
Sine | sine 1000 |
Square | square 440 |
Triangle | triangle 200 |
Sawtooth | sawtooth 1500 |
White noise | synth 5 whitenoise |
Pink noise | synth 5 pinknoise |