I've installed and imported all the required libraries (at least I think so):
!sudo apt-get install libportaudio2
!pip install sounddevice
import numpy as np
import matplotlib.pyplot as plt
import sounddevice as sd
And I am getting the following error when running this code:
wav_wave = np.array(tone, dtype=np.int16)
sd.play(wav_wave, blocking=True)
sd.stop()
The error below is caused by the sd.play
function.
PortAudioError: Error querying device -1