Giter VIP home page Giter VIP logo

sound-level-meter's Introduction

Sound-level-meter

This piece of Python script measures sound level. The script depends on the sd ('sound device'), numpy, CFFI and Portaudio libraries.

Installation:

  1. Make sure pip is installed and has all the necessesary tools:

python3 -m pip install setuptools --user

  1. Install dependencies:

python3 -m pip install cffi --user

brew install portaudio (on Mac OS X)

  1. Install sounddevice:

python3 -m pip install sounddevice --user

sound-level-meter's People

Contributors

alkopop79 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sound-level-meter's Issues

ModuleNotFoundError: No module named 'sounddevice'

Seems like project is not working, some problem with dependencies:

a@x79:~/test/Sound-level-meter$ sudo pip install sounddevice
Requirement already satisfied: sounddevice in /root/.local/lib/python3.10/site-packages (0.4.6)
Requirement already satisfied: CFFI>=1.0 in /usr/local/lib/python3.10/dist-packages (from sounddevice) (1.16.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from CFFI>=1.0->sounddevice) (2.21)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
a@x79:~/test/Sound-level-meter$ pip show sounddevice
WARNING: Package(s) not found: sounddevice
a@x79:~/test/Sound-level-meter$ python3 slm.py 
Traceback (most recent call last):
  File "/home/a/test/Sound-level-meter/slm.py", line 1, in <module>
    import sounddevice as sd
ModuleNotFoundError: No module named 'sounddevice'
a@x79:~/test/Sound-level-meter$ python3 --version
Python 3.10.12

don't work, updates killed it ig


PortAudioError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_9248\1048679471.py in
9 print (int(volume_norm))
10
---> 11 with sd.Stream(callback=print_sound):
12 sd.sleep(duration * 1000)

~\AppData\Roaming\Python\Python39\site-packages\sounddevice.py in init(self, samplerate, blocksize, device, channels, dtype, latency, extra_settings, callback, finished_callback, clip_off, dither_off, never_drop_input, prime_output_buffers_using_stream_callback)
1798
1799 """
-> 1800 _StreamBase.init(self, kind='duplex', wrap_callback='array',
1801 **_remove_self(locals()))
1802

~\AppData\Roaming\Python\Python39\site-packages\sounddevice.py in init(self, kind, samplerate, blocksize, device, channels, dtype, latency, extra_settings, callback, finished_callback, clip_off, dither_off, never_drop_input, prime_output_buffers_using_stream_callback, userdata, wrap_callback)
896 userdata = _ffi.NULL
897 self._ptr = _ffi.new('PaStream**')
--> 898 _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
899 samplerate, blocksize, stream_flags,
900 callback_ptr, userdata),

~\AppData\Roaming\Python\Python39\site-packages\sounddevice.py in _check(err, msg)
2743 hosterror_text = _ffi.string(info.errorText).decode()
2744 hosterror_info = host_api, info.errorCode, hosterror_text
-> 2745 raise PortAudioError(errormsg, err, hosterror_info)
2746
2747 raise PortAudioError(errormsg, err)

PortAudioError: Error opening Stream: Unanticipated host error [PaErrorCode -9999]: 'Undefined external error.' [MME error 1]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.