Git Product home page Git Product logo

parselmouth's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parselmouth's Issues

Calculate Pitch and Formants frame wise

How can we calculate pitch and formants on frame level. Suppose we we have and MFCC shape of (100, 39) and in order to append the pitch and formants to this shape, the pitch and formants need to be calculated at frame level (i. I want to to define the wind-len and win-hop)

Example for cross_correlate function

Hello,

I am doing some tests to migrate from praat script to parselmouth.
May you give some example for using the croos_correlate function?

My praat script is (part of):

             Read from file... 'directory$'/'sound1$'
             Rename... 1

             Read from file... 'directory$'/'sound2$'
             Rename... 2

             select Sound 1
             plus Sound 2

             Cross-correlate... -0.20 0.20 yes
             ccvalue = Get maximum... 0 0 Sinc70

I wrote this in Python:

import parselmouth as pm
s1 = pm.Sound("sound1.wav")
s2 = pm.Sound("sound2.wav")
cc = s1.cross_correlate(s2)

Everything is going well but I do not know how to extract the cc value...
Thank you
Olivier

Retrieving formants time series

Hello,

I'd like to retrieve the 3 first formants array for a Sound object. I came up with this code:

formants = snd.to_formant_burg()
formants_ts = {}
timestep = formants.get_time_step()
for formant_idx in range(1,4):
    formants_ts[formant_idx] = np.array([formants.get_value_at_time(formant_idx, i * timestep) 
                              for i in range(0, formants.get_number_of_frames())])

It seems to work fine, but is there any cleaner way to do that using your API (especially considering the fact that when the formants are written to text, it's obvious it must be cleanly stored somewhere).

Typo in parselmouth.PraatError (opening 64-bit WAV)

When trying to open a 64-bit WAV file in parselmouth (v0.3.3), we get the following error:

parselmouth.PraatError: Too few bits per sample (64; the maximum is 32).

If I'm not mistaken, the error should read: Too many bits per sample (64; the maximum is 32). The maximum allowed bit-depth is 32, so 64 is too high.

Don't bundle dependencies

You should try to not bundle pybind11 in your sourcecode, instead define it as an setup_requires in setup.py.

[dev issue] docs folder is not a parallel build ready

I'm trying to build the project on my Windows PC with Ninja+MSVC and CMake generate step fails with an error:

ninja: error: build.ninja:13872: multiple rules generate docs/doctrees [-w dupbuild=err]

This error apparently pops up when multiple cmake targets point to the same build folder/file.

The root cause of this issue seems to be in docs\CMakeLists.txt which reads

add_custom_target(docs
        COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:parselmouth> ${Python_EXECUTABLE} -m sphinx -M html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
        BYPRODUCTS doctrees/ html/
        DEPENDS parselmouth
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

add_custom_target(docs_linkcheck
        COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:parselmouth> ${Python_EXECUTABLE} -m sphinx -M linkcheck ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
        BYPRODUCTS doctrees/ linkcheck/
        DEPENDS parselmouth
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

There are 2 targets with the same BYPRODUCTS, thus a parallel builder sees an issue.

"I think" the fix is to combine it into one target:

add_custom_target(docs
        COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:parselmouth> ${Python_EXECUTABLE} -m sphinx -M html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
        COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=$<TARGET_FILE_DIR:parselmouth> ${Python_EXECUTABLE} -m sphinx -M linkcheck ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
        BYPRODUCTS doctrees/ html/ linkcheck/
        DEPENDS parselmouth
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

I said "I think" because I'm building the project outside of Python at the moment and cannot complete the docs build due to missing parselmouth package in Python.

BTW, this is a great project, and I just dropped a note on Gitter for my intent to contribute FYI.

Best,
Kesh

build problem on MacOSX Catalina

Hello, I had been happily using praat-parselmouth, but then upgraded my macOS to Catalina. I had to upgrade Xcode and update my python setup, and am now having problems installing praat-parselmouth. I think they are in the cmake step. I'm seeing the following error messages, which all seem to come during compilation of Intensity.cpp:

"Using incompatible compiler: compiler should provide either or <experimental/optional>". (3 places)
"use of undefined operator nullopt; did you mean nullptr?" (2 places)

My versions are below:
gcc: Apple clang version 12.0.0 (clang-1200.0.32.28)
cmake version 3.19.2
pip 20.3.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
Python 3.9.1
numpy 1.19.5

I'm guessing that I should install a different version of gcc or maybe cmake. Do you have any suggestions? I am not sure if I am giving the right info for debugging the problem.... just FYI I used homebrew to update my python and pip installations, if that would matter - though I'm guessing it's more of a Cpp compiler issue.

Thank you for a great package!

Importing parselmouth in psychopy

Hi!

I've successfully installed parselmouth (praat-parselmouth using pip) & wish to use it for a staircase SNR experiment I am creating in psychopy. When I go to import parlsemouth in a code component of my trial & then try to run it, psychopy says

ModuleNotFoundError: No module named 'parselmouth'.

I am using Psyhopy3, python v 3.8 and on Mac OSX. I have tired uninstalling parselmouth & reinstalling but it doens't make a difference. Does anyone know how to fix this? Thank you!

update pytz 2015.7 to later versions

error: pandas 1.0.5 requires pytz>=2017.2, but you have pytz 2015.7 which is incompatible.
this occurs when i try to install using pip

i am running ubuntu 20.04 LTS and my python versions is 3.8.5

Extracting 12 Mel-frequency cepstral coefficients

Hi Yannick, I was hoping you might be willing to help me get past just one more issue:

I'm trying to extract 12 Mel-frequency cepstral coefficients (MFCCs) from a .wav file, and when I do the following:

sound = parselmouth.Sound(path)
mfcc_object = sound.to_mfcc(number_of_coefficients=12)
mfccs = mfcc_object.extract_features()
mfcc_arr = mfccs.as_array()
print(mfcc_arr.shape)

...the result on 3 different .wavs are

(4, 21)
(4, 2439)
(4, 114)

I'm expecting the resulting arrays to be 12 by (something), not 4 by (something). Where am I going wrong?

Segmentation fault (core dumped) on ppc64le

System: power 9, linux ppc64le
Anaconda version: Anaconda3-2021.11-Linux-ppc64le.sh, Anaconda3-2020.11-Linux-ppc64le.sh
python version: 3.7, 3.8
parselmouth version: 0.4.0

After successful installation using pip install, 'import parselmouth' gives Segmentation fault (core dumped).
parselmouth version 0.3.3 can work but I would like to install 0.4.0.

Are there alternative ways to install such as compiling from source?

Thanks!

Memory issues when generating voice report in bulk

OS: Ubuntu 18.04.4 LTS
python: 3.7.5

I am running the below function in a loop iterating over audio files between 10~60 seconds long.

def calc_voice_report(input_audio):
    sound = parselmouth.Sound(input_audio)
    pitch = sound.to_pitch()
    pulses = parselmouth.praat.call([sound, pitch], "To PointProcess (cc)")
    voice_report_str = \
        parselmouth.praat.call([sound, pitch, pulses], "Voice report", 0.0, 0.0, 75, 600, 1.3, 1.6, 0.03, 0.45)
    return voice_report_str

The resulting string is then parsed and saved into a csv.

After around 3k~8k files I ran into some sort of memory issue, either:

  • SIGFAULT 6
  • a parselmouth error stating that it's out of memory (did not save the error message will write it down if it happens again next time)
  • a computer freeze

I had similar issues running praat voice report in a praat script (using subprocess to call it from python) which makes me think there is a memory leak caused by the voice report module.

Is there a way to fully "clear" parselmouth of it's memory after a parselmouth.praat.call?

CMake build issue on Ubuntu 16.06, arm64

I'm looking to use Parselmouth on an NVIDIA Jetson TX2, but I'm running into this CMake error. I updated CMake to 13.3.1. The traceback from sudo pip install praat-parselmouth is as follows:

Installing collected packages: praat-parselmouth
  Running setup.py install for praat-parselmouth ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-zb2h1v06/praat-parselmouth/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-dt2lxbst/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    -- The C compiler identification is GNU 6.5.0
    -- The CXX compiler identification is GNU 6.5.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.7")
    -- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.6m.so
    -- Performing Test HAS_CPP14_FLAG
    -- Performing Test HAS_CPP14_FLAG - Success
    -- pybind11 v2.2.3
    -- Performing Test HAS_FLTO
    -- Performing Test HAS_FLTO - Success
    -- LTO enabled
    CMake Error at CMakeLists.txt:46 (add_subdirectory):
      add_subdirectory given source "tests" which is not an existing directory.

Could I only use C++ for pitch extraction ?

Dear,

Thanks to your great project, but if I want move it in cellphone , how should I do ?

Since I couldn't have the power to understand the praat source file in C++, so I can't know how to get the pitch.

Could You please help me ?

Maybe some API will be grateful.

Thanks a lot.

Lychee Tsu

Library Installation

Hi,
I want to ask why, after the installation process, PyCharm does not have the library referenced in the example code. The installation only creates a dist-info folder, and importing the parselmouth library in the code generates an error ModuleNotFoundError: No module named 'parselmouth'.
image

Python Version - 3.8.10
Ubuntu 20.04.2 LTS

Breaks JSON package in Python 3.7 on Arch linux

No idea why this is the case, but importing parselmouth has caused the JSON library to stop working, I assume due to some sort of reassignment of json.load or something similar.

Minimal case:

import json
import parselmouth
with open("main_survey", "r") as f:
      survey = json.load(f)

crashes, while if I run it without importing parselmouth it works fine.

output

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    survey = json.load(f)
  File "/usr/lib/python3.7/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.7/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4486: ordinal not in range(128)

Save as spreadsheet file?

Thanks for this awesome project!

Have I missed a way to save an object as a spreadsheet (like the Praat menu entry Save->Save as PitchTier spreadsheet file)? If not, are there any plans to add that function?

import error ?

Dear,
After I pip install praat-parselmouth,and then

import parselmouth
Traceback (most recent call last):
File "<pyshell#1>", line 1, in
import parselmouth
File "D:\python\lib\site-packages\parselmouth_init_.py", line 22, in
from parselmouth.base import Parselmouth
File "D:\python\lib\site-packages\parselmouth\base.py", line 30, in
from parselmouth.adapters.dfp.interface import DFPInterface
File "D:\python\lib\site-packages\parselmouth\adapters\dfp\interface.py", line 17, in
from urllib import quote
ImportError: cannot import name 'quote'

Could you help me ?
Thx

Feature Extraction?

Can Parselmouth be used for pitch tracking and MFCC feature extraction from audio?

Installation Failing when using Visual Studio 2022 and Windows 11

System Information

Operating System - Windows 11
Python Version - 3.10.0
Visual Studio - Visual Studio 2022
Package Manager - PIP

Description

The problem may be due to Windows 11 or VS 2022. When I try to install the package, it gives me the following error:

Building wheels for collected packages: praat-parselmouth
  Building wheel for praat-parselmouth (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\soham\miniconda3\python.exe' 'C:\Users\soham\miniconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\soham\AppData\Local\Temp\tmp1gyd0p55'
       cwd: C:\Users\soham\AppData\Local\Temp\pip-install-ehh6vn7e\praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e
  Complete output (343 lines):
  WARNING: '' not a valid package name; please use only .-separated package names in setup.py
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 16 2019

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Running

     'nmake' '-?'

    failed with:

     The system cannot find the file specified


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- The C compiler identification is unknown
  CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
    The CMAKE_C_COMPILER:

      cl

    is not a full path and was not found in the PATH.

    To use the JOM generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 15 2017

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Running

     'nmake' '-?'

    failed with:

     The system cannot find the file specified


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- The C compiler identification is unknown
  CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
    The CMAKE_C_COMPILER:

      cl

    is not a full path and was not found in the PATH.

    To use the JOM generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/soham/AppData/Local/Temp/pip-install-ehh6vn7e/praat-parselmouth_8aabdbb89a704e4daaa852d44164ce2e/_cmake_test_compile/build/CMakeFiles/CMakeError.log".


  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 16 2019 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 16 2019 x64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 16 2019 x64 v141" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 16 2019 x64 v141" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 16 2019 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 16 2019 x64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 x64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 15 2017 x64 v141" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 15 2017 x64 v141" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 x64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 15 2017 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 15 2017 x64 v141)" generator - failure
  --------------------------------------------------------------------------------

  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building Windows wheels for requires Microsoft Visual Studio 2017 or 2019:

    https://visualstudio.microsoft.com/vs/

  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for praat-parselmouth
Failed to build praat-parselmouth
ERROR: Could not build wheels for praat-parselmouth which use PEP 517 and cannot be installed directly

cannot import name 'quote' from 'urllib'

Any solution for cannot import name 'quote' from 'urllib' ??
At one point it was working just fine for me, then I restarted my PC now it doesn't and gives me this error.

Thanks!

Note: I've seen your thread about the problem that was a year ago, any solution until this moment?

Hi,

Before submitting your issue, please check the following points, and then remove this text. Thank you!

  • Someone else might already have run into the same problem. Please check the documentation and other issues before creating a new issue.
  • If you have a question rather than a problem, please consider asking it in the Gitter chat room or in the Google discussion group. This way, we can reserve these issues for bug reports and feature requests.
  • If you think it might be relevant, include information on your operating system (Linux, macOS, Windows) and the version of Python you are using.

API for change_gender?

Hi,
Are there any plans to port the change_gender API into parselmouth in the near future?
Thanks!

Remove noise with Parselmouth

I found that Praat can do some noise reduction. But it filters out a range of frequncies and does not take a sample of noise.
Do you know how I can remove noise from audio based on the sample of noise with Parselmouth?

ImportError: DLL load failed: %1 is not a valid Win32 application.

@jyothika12 Seems your additional problem from #10 is bigger than expected. Let's continue the discussion here, in a separate issue.

I have just tried the same on a freshly installed Python 3.7, 32-bit on a Windows installation, but I cannot reproduce the error:

C:\Users\Yannick>powershell                                                                                                                                                                                                                                                        
Windows PowerShell                                                                                                                                                                                                                                                                 
Copyright (C) Microsoft Corporation. All rights reserved.                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                   
PS C:\Users\Yannick> & 'C:\Program Files (x86)\Python37-32/python.exe'                                                                                                                                                                                                             
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32                                                                                                                                                                                       
Type "help", "copyright", "credits" or "license" for more information.                                                                                                                                                                                                             
>>> ls                                                                                                                                                                                                                                                                             
Traceback (most recent call last):                                                                                                                                                                                                                                                 
  File "<stdin>", line 1, in <module>                                                                                                                                                                                                                                              
NameError: name 'ls' is not defined                                                                                                                                                                                                                                                
>>> import sys                                                                                                                                                                                                                                                                     
>>> import subprocess                                                                                                                                                                                                                                                              
>>> subprocess.call([sys.executable, "-m", "pip", "install", "-U", "--force-reinstall", "praat-parselmouth"])                                                                                                                                                                      
Collecting praat-parselmouth                                                                                                                                                                                                                                                       
  Downloading https://files.pythonhosted.org/packages/3b/32/f344046db6759ed2b3939f7671caf469ad15489dfe97c56b37807d4c4232/praat_parselmouth-0.3.3-cp37-cp37m-win32.whl (6.9MB)                                                                                                      
    100% |████████████████████████████████| 6.9MB 2.0MB/s                                                                                                                                                                                                                          
Collecting numpy>=1.7.0 (from praat-parselmouth)                                                                                                                                                                                                                                   
  Downloading https://files.pythonhosted.org/packages/07/46/656c25b39fc152ea525eef14b641993624a6325a8ae815b200de57cff0bc/numpy-1.16.4-cp37-cp37m-win32.whl (10.0MB)                                                                                                                
    100% |████████████████████████████████| 10.0MB 2.1MB/s                                                                                                                                                                                                                         
Installing collected packages: numpy, praat-parselmouth                                                                                                                                                                                                                            
  The script f2py.exe is installed in 'C:\Program Files (x86)\Python37-32\Scripts' which is not on PATH.                                                                                                                                                                           
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.                                                                                                                                                                
Successfully installed numpy-1.16.4 praat-parselmouth-0.3.3                                                                                                                                                                                                                        
You are using pip version 19.0.3, however version 19.1.1 is available.                                                                                                                                                                                                             
You should consider upgrading via the 'python -m pip install --upgrade pip' command.                                                                                                                                                                                               
0                                                                                                                                                                                                                                                                                  
>>> import parselmouth                                                                                                                                                                                                                                                             
>>>                         

Dependency conflict with pandas library

I was installing pandas library inside my virtual environment, after installing parselmouth and while installing I came across the following error-

Collecting pandas
  Downloading pandas-1.1.3-cp36-cp36m-win_amd64.whl (8.7 MB)
     |████████████████████████████████| 8.7 MB 172 kB/s
Collecting python-dateutil>=2.7.3
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Requirement already satisfied: numpy>=1.15.4 in c:\users\shalabh\desktop\project\botenv\lib\site-packages (from pandas) (1.19.2)
Collecting pytz>=2017.2
  Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Requirement already satisfied: six>=1.5 in c:\users\shalabh\desktop\project\botenv\lib\site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Installing collected packages: python-dateutil, pytz, pandas
  Attempting uninstall: pytz
    Found existing installation: pytz 2015.7
    Uninstalling pytz-2015.7:
      Successfully uninstalled pytz-2015.7
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

parselmouth 1.1.1 requires pytz==2015.7, but you'll have pytz 2020.1 which is incompatible.
Successfully installed pandas-1.1.3 python-dateutil-2.8.1 pytz-2020.1

The main issue is that parselmouth requires a different version of pytz than pandas which is such a common library.

Is there a way to resolve this dependency conflict? If not, can we upgrade the pytz version used in parselmouth ?

Trouble getting PointProcess from sound with Parselmouth

I'm trying to use Parselmouth to calculate jitter from a .wav file, but PointProcess is giving me trouble.

Following this, I do

sound = parselmouth.Sound(path) # path = path to .wav
pointProcess = parselmouth.praat.call(sound, "To PointProcess (periodic, cc)")

intending to follow up with

jitter = parselmouth.praat.call(pointProcess, "Get jitter (local)", 0, 0, 0.0001, 0.02, 1.3)

but before I can, I get this error:

Command "To PointProcess (periodic, cc)" not available for given objects

Any clue what I'm doing wrong?

ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)

i am using praat from parselmouth in gooogle colab and i am getting this error when importing from parselmouth.praat import call

/usr/local/lib/python3.7/dist-packages/parselmouth/adapters/dfp/interface.py in <module>()
     15 from datetime import timedelta
     16 from pytz import timezone
---> 17 from urllib import quote
     18 
     19 # Parselmouth Imports

ImportError: cannot import name 'quote' from 'urllib' (/usr/lib/python3.7/urllib/__init__.py)

i tried installing diffirent version of urllib but nothing worked
i know that urllib uses import urllib.parse.quote instead offrom urllib import quote but i am not the one importing the urllib package it s the praat module and i cannot change it

Saving Praat images

Is it possible to save Praat images to png files (or pdf for that matter) from Parselmouth?

Running the following script with parselmouth.praat.run_file creates the prapic file, but not the png one. praat --run creates both files.

Paint rectangle... 0.5 0 3 1 2
Save as praat picture file... test.prapic
Save as 300-dpi PNG file... test.png

Running on Linux with:
praat-parselmouth 0.3.3
python 3.8.2

"parselmouth.praat.run_file" is not thread safe?

objects = run_file(mltrnl_praat, -20, 2, 0.3, "no", wavfile, path, 80, 400, 0.01, capture_output=True)
print(objects)

The arguments is same, but sometimes return objects is not same.

run_file can be called by different threads?

Can't install the library

I am using Linux OS (Ubuntu 16.04) and Python version 3.5.

I have just installed the library (on my Anaconda virtenv) and I am getting an error when trying to import it:

import parselmouth

"Traceback (most recent call last):
File "", line 1, in
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/init.py", line 22, in
from parselmouth.base import Parselmouth
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/base.py", line 30, in
from parselmouth.adapters.dfp.interface import DFPInterface
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/adapters/dfp/interface.py", line 17, in
from urllib import quote
ImportError: cannot import name 'quote' "

package version 0.3.2.post2

I found the version in wheel meta (0.3.2) does not match the version provided on pypi (0.3.2.post2).
It may cause problems when installing with version specifications like pip install praat_parselmouth==0.3.2.
Hope the wheel could contain the right version (assign version="0.3.2.post2" in setup.py) or just preserve the package of version 0.3.2 on pypi.

Suds-jurko error while installing

poetry add Parselmouth

Package operations: 10 installs, 0 updates, 0 removals

• Installing pyparsing (3.0.6)
• Installing httplib2 (0.20.2)
• Installing oauth2client (4.1.3)
• Installing pysocks (1.7.1)
• Installing pytz (2015.7)
• Installing pyyaml (6.0)
• Installing suds-jurko (0.6): Failed

EnvCommandError

ERROR: Command errored out with exit status 1:

error in suds-jurko setup command: use_2to3 is invalid.

Failed to add packages, reverting the pyproject.toml file to its original content.

Python: v.3.9.8
Os: MacOs Catalina

pipenv install error

Hello,

I'm trying to install parselmouth through pipenv on Windows and get this error:

Error:  An error occurred while installing praat-parselmouth!
  Failed building wheel for praat-parselmouth
Command "c:\users\mitch\.virtualenvs\pipenv-trial2-88_u4rjn\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\mitch\\AppData\\Local\\Temp\\pip-install-_mw2pug9\\praat-parselmouth\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\mitch\AppData\Local\Temp\pip-record-ox_jq1ly\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\mitch\.virtualenvs\pipenv-trial2-88_u4rjn\include\site\python3.7\praat-parselmouth" failed with error code 1 in C:\Users\mitch\AppData\Local\Temp\pip-install-_mw2pug9\praat-parselmouth\

I have also previously tried to install directly with pip and received a similar error. I should also note this issue is only occurring on Windows, I was able to install and use it easily on Linux.

Thanks

speaker diarization with parselmouth?

You've mentioned to use github to communicate :)

I'd like to figure if we parselmouth can enable speaker diarization:

  • based on 2 channels in a stereo recording
  • out of a mono recording.

I'm happy to help and contribute to add this if not already possible.

How to change advanced pitch settings?

Hi there,
there is advanced pitch settings that allows to change parameters like voicing threshold in Praat, how can I modify those settings in Parselmouth?

Segfault when computing formants on stereo audio from array

Hey,

First, i'd like to thank you again for your work on parselmouth. It's an amazing work.
I ran into a small problem that can become a bit troublesome since this won't output any stacktrace.
An example is worth a thousand words:

from parselmouth import Sound
from scipy.io.wavfile import read
rate, array = read("some_stereo_audio.wav")
snd = Sound(array, rate)
snd.to_formant_burg() # <--------- this will segfault

However, this works if I load the sound directly from the path (snd = Sound("some_stereo_audio.wav")).

I'm running python 3.8 on ubuntu, but this segfaulted all the same on a python 3.7 on centos. I tested it on all parselmouth versions >= 0.3.2

Anyway to reconstruct a Sound object from a manipulated pitch?

From the reference page, there's no mention of anyway to replace pitch back to the sound object. In other word, If I were to set pitch.selected_array['frequency'] to new array of float, can I put the pitch back to the sound object so I can save it as a wav. I notice call([pitch_tier, manipulation], "Replace pitch tier") technically replaces the pitch in the manipulation object, but there's seems to be no way of altering the pitch_tier either than call('Multiply frequencies'). Any help would be appreciated.

Documentation of Expected Outputs

I am trying to use features of the parselmouth module and I'm finding that some methods lack enough documentation to know what their output is. Usually I can work backwards from the output of the same function in Praat itself, but in the case of the MFCC(CC).extract_features() method I do not see an equivalent function in Praat. Moreover, the output from this method does not match the output from to_matrix() or other methods for getting values from the object. Using parselmouth in general would be made a lot easier by updating the documentation with expected outputs and what they are.

NameError: name 'parselmouth' is not defined,but I can use part of the module functions.

evn:
Ubuntu 16.04+python 3.6 +pycharm

pip install praat-parselmouth
in my code:

import parselmouth
print("version:",parselmouth.version)
import parselmouth.WindowShape as windowshape

spectrogram = pre_emphasized_snd.to_spectrogram(window_length=0.03, maximum_frequency=8000 ,window_shape=windowshape.GAUSSIAN
)

Error info:
import parselmouth.WindowShape as windowshape
ModuleNotFoundError: No module named 'parselmouth.WindowShape'; 'parselmouth' is not a package

If I remove the code "window_shape=windowshape.GAUSSIAN" and " import parselmouth.WindowShape as windowshape"
It's OK.

I am confused.
Thank you very much if you can give me any help.

AttributeError: module 'parselmouth' has no attribute 'Sound'

Running into an error at the first line.

import parselmouth

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

sns.set()

snd = parselmouth.Sound("the_north_wind_and_the_sun.wav")
plt.figure()
plt.plot(snd.xs(), snd.values.T)
plt.xlim([snd.xmin, snd.xmax])
plt.xlabel("time [s]")
plt.ylabel("amplitude")
plt.show() # or plt.savefig("sound.png"), or plt.savefig("sound.pdf")


File "parselmouth.py", line 1, in
import parselmouth
File "/Users/shayana/Documents/work/dsp/parselmouth.py", line 10, in
snd = parselmouth.Sound("the_north_wind_and_the_sun.wav")
AttributeError: module 'parselmouth' has no attribute 'Sound'

parselmouth.praat.call stuck in "Change gender"

Hello,

I have multiple processes of a function calling the parselmouth.praat.call(...). After certain number of iterations, the program hangs forever. Is this because the praat.call() also spawns another subprocess? What would be the recommended way to use praat.call in multiprocessing?

Thanks!

How to match time steps?

I want to match time steps between mel-spectrogram and pitch or mel-spectrogram and intensity.

for example. I convert Audio A to mel-spectrogram that size of [682, 3663], and to pitch that size of [28]

Thanks.

pip: praat-parselmouth-0.3.2.post2.tar.gz has inconsistent version: filename has '0.3.2.post2', but metadata has '0.3.2'

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.