shichao-an / soundmeter

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

Not working with Python3 #8

Open erikvold opened 8 years ago

erikvold commented 8 years ago

I tried this with python3 on osx 10.11 and ran into a few errors, here they are in received order:

all standard python2 -> python3 conversion issues, which I worked through with some quick fixes, and finally got to this attempt:

$ soundmeter --collect --seconds 10
2016-06-03 20:24:59.760 Python[6027:183774] 20:24:59.759 WARNING:  140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Collecting RMS values...
Traceback (most recent call last):
  File "/usr/local/bin/soundmeter", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/site-packages/soundmeter/meter.py", line 311, in main
    m.start()
  File "/usr/local/lib/python3.5/site-packages/soundmeter/meter.py", line 116, in start
    self.record()  # Record stream in `AUDIO_SEGMENT_LENGTH' long
  File "/usr/local/lib/python3.5/site-packages/soundmeter/meter.py", line 90, in record
    data = self.stream.read(FRAMES_PER_BUFFER)
  File "/usr/local/lib/python3.5/site-packages/pyaudio.py", line 608, in read
    return pa.read_stream(self._stream, num_frames, exception_on_overflow)
OSError: [Errno -9981] Input overflowed

Which didn't seem like a standard error, so I moved to another osx to try python2, and ran in to issue #7, but that is a separate issue...

shichao-an commented 8 years ago

It seems I didn't create a release yet to include the commits that support Python 3. Can you try to install the master branch?

AlphaMorphe commented 7 years ago

Hi, i work on an raspberry for use it as a soundmeter with an usb mic, have the same issue and i'm on the master branch

pi@raspberrypi ~> soundmeter
/usr/local/lib/python2.7/dist-packages/pydub/utils.py:165: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Traceback (most recent call last):
  File "/usr/local/bin/soundmeter", line 9, in <module>
    load_entry_point('soundmeter==0.1.3', 'console_scripts', 'soundmeter')()
  File "/usr/local/lib/python2.7/dist-packages/soundmeter-0.1.3-py2.7.egg/soundmeter/meter.py", line 318, in main
    m.start()
  File "/usr/local/lib/python2.7/dist-packages/soundmeter-0.1.3-py2.7.egg/soundmeter/meter.py", line 118, in start
    record = self.record()
  File "/usr/local/lib/python2.7/dist-packages/soundmeter-0.1.3-py2.7.egg/soundmeter/utils.py", line 51, in start
    g.next()
  File "/usr/local/lib/python2.7/dist-packages/soundmeter-0.1.3-py2.7.egg/soundmeter/meter.py", line 92, in record
    data = self.stream.read(FRAMES_PER_BUFFER)
  File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 608, in read
    return pa.read_stream(self._stream, num_frames, exception_on_overflow)
IOError: [Errno -9981] Input overflowed