Code Monkey home page Code Monkey logo

Comments (9)

CorentinJ avatar CorentinJ commented on July 28, 2024

You'll need a backend for librosa. See this thread: librosa/librosa#219 (comment)

from resemblyzer.

marcoippolito avatar marcoippolito commented on July 28, 2024

Still struggling... :

(base) (Resemblyzer) marco@pc:~/Resemblyzer$ python3 demo02_diarization.py
Traceback (most recent call last):
  File "demo02_diarization.py", line 2, in <module>
    from demo_utils import *
  File "/home/marco/Resemblyzer/demo_utils.py", line 1, in <module>
    from mpl_toolkits.axes_grid1 import make_axes_locatable
ModuleNotFoundError: No module named 'mpl_toolkits'
(base) (Resemblyzer) marco@pc:~/Resemblyzer$ python3 demo02_diarization.py
Traceback (most recent call last):
  File "demo02_diarization.py", line 2, in <module>
    from demo_utils import *
  File "/home/marco/Resemblyzer/demo_utils.py", line 1, in <module>
    from mpl_toolkits.axes_grid1 import make_axes_locatable
ModuleNotFoundError: No module named 'mpl_toolkits'
(base) (Resemblyzer) marco@pc:~/Resemblyzer$ pip3 install mpl_toolkits
Collecting mpl_toolkits
 ERROR: Could not find a version that satisfies the requirement mpl_toolkits (from versions: none)
 ERROR: No matching distribution found for mpl_toolkits
(base) (Resemblyzer) marco@pc:~/Resemblyzer$ 

(base) (Resemblyzer) marco@pc:~/Resemblyzer$ conda install -c conda-forge mpl_toolkits
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - mpl_toolkits

Current channels:

   - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.

from resemblyzer.

CorentinJ avatar CorentinJ commented on July 28, 2024

Thank you for reporting that, I believe this is due to your matplotlib version mismatching mine. I have 3.1.1, what is yours (pip freeze | grep matplotlib)?

from resemblyzer.

marcoippolito avatar marcoippolito commented on July 28, 2024

Solved that problem by installing matplotlib (version 3.1.1) (I discovered it was not installed).
But now got new issue:

(Resemblyzer) marco@pc:~/Resemblyzer$ python3 demo02_diarization.py
Traceback (most recent call last):
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/librosa
/core/audio.py", line 127, in load
    with sf.SoundFile(path) as sf_desc:
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/soundfile.py", line 
627, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/soundfile.py", line 
1182, in _open
    "Error opening {0!r}: ".format(self.name))
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/soundfile.py", line 
1355, in _error_check
    raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'audio_data/X2zqiX6yL3I.mp3': File contains data in an unknown 
format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo02_diarization.py", line 14, in <module>
    wav = preprocess_wav(wav_fpath)
  File "/home/marco/Resemblyzer/resemblyzer/audio.py", line 27, in preprocess_wav
    wav, source_sr = librosa.load(fpath_or_wav, sr=None)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/librosa
/core/audio.py", line 142, in load
    y, sr_native = __audioread_load(path, offset, duration, dtype)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/librosa
/core/audio.py", line 164, in __audioread_load
    with audioread.audio_open(path) as input_file:
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/audioread
/__init__.py", line 116, in audio_open
    raise NoBackendError()
audioread.exceptions.NoBackendError

from resemblyzer.

CorentinJ avatar CorentinJ commented on July 28, 2024

You still need to install a backend

from resemblyzer.

marcoippolito avatar marcoippolito commented on July 28, 2024
(Resemblyzer) (base) marco@pc:~/Resemblyzer$ conda install -c conda-forge audioread
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

(base) (Resemblyzer) marco@pc:~/Resemblyzer$ python3 demo02_diarization.py
Loaded the voice encoder model on cpu in 0.06 seconds.
Running the continuous embedding on cpu, this might take a while...
Traceback (most recent call last):
  File "demo02_diarization.py", line 42, in <module>
    interactive_diarization(similarity_dict, wav, wav_splits)
  File "/home/marco/Resemblyzer/demo_utils.py", line 171, in interactive_diarization
    play_wav(wav, blocking=False)
  File "/home/marco/Resemblyzer/demo_utils.py", line 35, in play_wav
    sd.play(wav, sampling_rate, blocking=blocking)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line
 154, in play
    **kwargs)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line
 2417, in start_stream
    **kwargs)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line
 1374, in __init__
    **_remove_self(locals()))
 File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line 
697, in __init__
    extra_settings, samplerate)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line 
2490, in _get_stream_parameters
    info = query_devices(device)
  File "/home/marco/Resemblyzer/Resemblyzer/lib/python3.7/site-packages/sounddevice.py", line 
488, in query_devices
    raise PortAudioError('Error querying device {0}'.format(device))
sounddevice.PortAudioError: Error querying device -1

from resemblyzer.

CorentinJ avatar CorentinJ commented on July 28, 2024

Good catch, you will either need to put an audio output device or disable the calls to sd.play in demo_utils. I'll fix that later

from resemblyzer.

CorentinJ avatar CorentinJ commented on July 28, 2024

With cdd51df, you should now be fine. It should only print an error when trying to play the audio but the program should work.

from resemblyzer.

yunfei-shi avatar yunfei-shi commented on July 28, 2024

I solve it by install ffmpeg on ubuntu18.04: sudo apt install ffmpeg.

from resemblyzer.

Related Issues (20)

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.