yannickjadoul / parselmouth Goto Github PK
View Code? Open in Web Editor NEWPraat in Python, the Pythonic way
Home Page: https://parselmouth.readthedocs.io/
License: GNU General Public License v3.0
Praat in Python, the Pythonic way
Home Page: https://parselmouth.readthedocs.io/
License: GNU General Public License v3.0
Is it possible? I didn't find this in documentation.
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)
In Python 3.7.6, the following Parselmouth code
left = sound.extract_left_channel()
and
left = call(sound, "Extract one channel", "Left")
seems to produce the right channel (channel 2).
sound.convert_to_mono() produces the same behavior.
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
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).
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.
You should try to not bundle pybind11 in your sourcecode, instead define it as an setup_requires
in setup.py
.
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
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!
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!
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
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?
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!
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:
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
?
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.
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
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'.
Python Version - 3.8.10
Ubuntu 20.04.2 LTS
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)
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?
Can parselmouth be used to extract linear predictive coding coefficients?
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
Could I get pitch correlation with Praat like reaper ? Thank you !
ImportError: cannot import name 'quote'.
Can Parselmouth be used for pitch tracking and MFCC feature extraction from audio?
Operating System - Windows 11
Python Version - 3.10.0
Visual Studio - Visual Studio 2022
Package Manager - PIP
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
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?
Before submitting your issue, please check the following points, and then remove this text. Thank you!
Hi,
Are there any plans to port the change_gender API into parselmouth in the near future?
Thanks!
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?
@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
>>>
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
?
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?
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
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
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?
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' "
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.
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
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
You've mentioned to use github to communicate :)
I'd like to figure if we parselmouth can enable speaker diarization:
I'm happy to help and contribute to add this if not already possible.
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?
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
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.
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.
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 windowshapespectrogram = 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.
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'
Can Parselmouth be used for play and annotation from audio?
@YannickJadoul
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!
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.
requirements.txt:
praat-parselmouth>=0.3.2
Run
pip3 install -r requirements.txt
WARNING: Requested praat-parselmouth>=0.3.2.post2 from https://files.pythonhosted.org/packages/0e/7e/f18db0e8b7057966766a452bfd57be13a5871ef920616451e9ba6eead664/praat-parselmouth-0.3.2.post2.tar.gz#sha256=64b085e95ee06b06b124e493e2e3ef57179e89ec8b34dac59bce12ccb6d6c335 (from -r requirements.txt (line 7)), but installing version 0.3.2
WARNING: Discarding https://files.pythonhosted.org/packages/0e/7e/f18db0e8b7057966766a452bfd57be13a5871ef920616451e9ba6eead664/praat-parselmouth-0.3.2.post2.tar.gz#sha256=64b085e95ee06b06b124e493e2e3ef57179e89ec8b34dac59bce12ccb6d6c335 (from https://pypi.org/simple/praat-parselmouth/). Requested praat-parselmouth>=0.3.2.post2 from https://files.pythonhosted.org/packages/0e/7e/f18db0e8b7057966766a452bfd57be13a5871ef920616451e9ba6eead664/praat-parselmouth-0.3.2.post2.tar.gz#sha256=64b085e95ee06b06b124e493e2e3ef57179e89ec8b34dac59bce12ccb6d6c335 (from -r requirements.txt (line 7)) has inconsistent version: filename has '0.3.2.post2', but metadata has '0.3.2'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.