shichao-an / soundmeter

Simple real-time sound meter
https://soundmeter.shichao.io
BSD 2-Clause "Simplified" License
82 stars 27 forks source link

maxChans failed #29

Open Blyzz616 opened 5 years ago

Blyzz616 commented 5 years ago

Hi there,

I'm trying to get your soundmeter working on a Raspberry Pi Zero W.

I'm getting the following error when I try do anything:

Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514 Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818 Traceback (most recent call last): File "/usr/local/bin/soundmeter", line 11, in load_entry_point('soundmeter==0.1.5', 'console_scripts', 'soundmeter')() File "/usr/local/lib/python2.7/dist-packages/soundmeter/meter.py", line 321, in main m = Meter(*kwargs) File "/usr/local/lib/python2.7/dist-packages/soundmeter/meter.py", line 66, in init frames_per_buffer=self.config.FRAMES_PER_BUFFER) File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 750, in open stream = Stream(self, args, kwargs) File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 441, in init self._stream = pa.open(arguments) IOError: [Errno -9998] Invalid number of channels

I have no experience with Python, so not sure what I'm looking at here.

krzyk commented 5 years ago

Same issue on my side, Raspberry Pi 3B+ with an usb mic

krzyk commented 5 years ago

@Blyzz616 This is solved in https://github.com/shichao-an/soundmeter/issues/1 (you need to create a config with a channel = 1