I am trying to play audio through the play function of pydub play(audio_segment)
but the function was getting constantly stuck on this function without actually playing the audio.
It seems like pydub is getting stuck on the def _play_with_pyaudio(seg):
in the stream.open
function of pyaudio on the line stream = Stream(self, *args, **kwargs)
.
If I pause between the creation of pyaudio and the opening of the audio stream, it plays through the audio stream just fine.
p = pyaudio.PyAudio()
stream = p.open(format=p.get_format_from_width(seg.sample_width),
channels=seg.channels,
rate=seg.frame_rate,
output=True)
I am not getting an error, neither in code or in ALSA debug messages. How do I resolve this, I made sure to reinstall pyaudio, is it a problem in the library or in pyaudio? It seems to me that the problem is somewhere in pyaudio.
I am currently on pyaudio-0.2.11 and pydub 0.23.1. I am working in my personal Lubuntu virtual environment.