Python Forum
pyaudio sound output producing strange errors on linux mint
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyaudio sound output producing strange errors on linux mint
#1
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.
Reply
#2
problem discussed here: https://github.com/Uberi/speech_recognition/issues/100
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  print out is producing same graph mbrown009 2 1,898 May-31-2021, 12:36 AM
Last Post: mbrown009

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020