Python Forum
pyaudio sound output producing strange errors on linux mint - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: pyaudio sound output producing strange errors on linux mint (/thread-13254.html)



pyaudio sound output producing strange errors on linux mint - NeilUK - Oct-06-2018

I'm using linux Mint 18 (well, probably misusing, I'm an XP refugee linux noob), and trying to get a beep from a python 3.5 program. Lots of suggestions on the net, like print('\a'), none of which work. So finally, I take a sledgehammer to it with the following suggestion.

import pyaudio
import numpy as np

p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32,
                channels=1,
                rate=44100,
                frames_per_buffer=1024,
                output=True,
                output_device_index=1
                )
samples = np.sin(np.arange(10000)/20)
stream.write(samples.astype(np.float32).tostring())
stream.close()
Which works, and plays the appropriate tone through my default audio output.

But it also throws up the following errors in the console

ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave

which is tedious, pollutes my other console outputs, and is slightly disturbing

Is this a linux issue, or a python issue?
Is python not addressing my hardware properly?
Is my 'all left at defaults' hardware setup lacking? It plays music and beeps just fine.
My ALSA is k4.4.0-133-generic.


RE: pyaudio sound output producing strange errors on linux mint - Larz60+ - Oct-07-2018

problem discussed here: https://github.com/Uberi/speech_recognition/issues/100