Shahabks / myprosody

A Python library for measuring the acoustic features of speech (simultaneous speech, high entropy) compared to ones of native speech.
https://shahabks.github.io/myprosody/
MIT License
232 stars 63 forks source link

1. Try again the sound of the audio was not clear 2. Please update with respect to python 3.9 #21

Closed j-j-kam closed 3 years ago

j-j-kam commented 3 years ago

I tried using python 3.9; 3.8 and 3.7 to run the examples & my own files with my own code but to no avail. Every time, even though the format of the audio file is correct i.e. 48kHz with 32 bits, the output of the process is "Try again the sound of the audio was not clear". Likewise, there is no error generated in the case of a non-existent directory indication.

import myprosody as mysp
import pickle
import shutil
import pyaudio
import wave

p = "suun3"
c = r"/Users/gk/Desktop/pythonProject/myprosody/dataset/audioFiles"

def analyse_tone():
    mysp.mysptotal(p, c)
    mysp.myspgend(p, c)

The output in both cases, if the dir name is right or wrong, is "Try again the sound of the audio was not clear"

Shahabks commented 3 years ago

please note that 1- Both My-Voice-Analysis and Myprosody work on Python 3.7 2- If you install My-Voice-Analysis through PyPi, please use: mysp=import("my-voice-analysis") instead of import myspsolution as mysp 3- It it better to keep the folder names as single entities for instance "Name_Folder" or "NameFolder" without space in the dirctoy path And these repos were tested on Windows

bbrij87 commented 3 years ago

Hello!

I have python 3.9 and I could find the solution for this problem.

I think you are setting the path wrong. You need to set this like this:

p="di" -> name of wav file c=r"C:\myprosody" -> now this is the most important thing.

You need to give the base/root of the folder only. Keep in mind scripts will expect/look for these files or folders: \dataset\audioFiles \dataset\essen

When you download myprosody folder, and set path of myprosody folder correctly, you will be able to run it.

The script autosets path for these 3 things: 1) sound=p+"/"+"dataset"+"/"+"audioFiles"+"/"+m+".wav" 2) sourcerun=p+"/"+"dataset"+"/"+"essen"+"/"+"MLTRNL.praat" 3) path=p+"/"+"dataset"+"/"+"audioFiles"+"/"

So you just need to setup the path to main folder.

Here is the screenshot of it working in python 3.9 My path here is myprosody/myprosody/ (all files in here)

image

I hope it helps!

fenggang12 commented 3 years ago

image I tried using python 3.7 to run the examples and my own dataset. Firstly, I used the format of audio files is 16 bit, and then I used ones which is 32 bit and 24 bit. However, they are not worked. I can only get the information about f0 values and durations. I want to get the formants values. The result is 'Try again the sound of the audio was not clear'. Can I get your help, please?

Shahabks commented 3 years ago

sure how long are the audio files? are they as long as 10 seconds or more?

On Mon, 17 May 2021, 10:47 fenggang12, @.***> wrote:

[image: image] https://user-images.githubusercontent.com/74233231/118421585-fb0a5a80-b6f3-11eb-8c00-a2d8fbe0c5a0.png I tried using python 3.7 to run the examples and my own dataset. Firstly, I used the format of audio files is 16 bit, and then I used ones which is 32 bit and 24 bit. However, they are not worked. I can only get the information about f0 values and durations. I want to get the formants values. The result is 'Try again the sound of the audio was not clear'. Can I get your help, please.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Shahabks/myprosody/issues/21#issuecomment-841922446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTX33V56BPOVQASAWFULJ3TOBYSDANCNFSM4ZQXS55Q .

fenggang12 commented 3 years ago

Hello! I'm glad to hear from you. My wavs are about 5 seconds. Is there any limit for the length of wavs? Must be 10 seconds or more?

fenggang12 commented 3 years ago

image image I used a wav file with 30 seconds, but I still can not extract the values of formants. What's wrong with me? I am looking forward to getting your help. Thank you.

Shahabks commented 3 years ago

there is a floor of 10 seconds that you can change it in the code if you wish. We set that limit to get better performance for our cases. Howere, tech has been significantly better since the time of development.

have you run to the same error using a 30 sec long audio file? 'try again' or different ones?

On Tue, 18 May 2021, 09:56 fenggang12, @.***> wrote:

[image: image] https://user-images.githubusercontent.com/74233231/118574267-a5e34d00-b7b6-11eb-9f62-155d67b2ce55.png [image: image] https://user-images.githubusercontent.com/74233231/118574279-abd92e00-b7b6-11eb-8c94-1896f7f50e2c.png I used a wav file with 30 seconds, but I still can not extract the values of formants. What's wrong with me? I am looking forward to getting your help. Thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Shahabks/myprosody/issues/21#issuecomment-842742242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTX33VXSAUENCODGLNA2KTTOG3LPANCNFSM4ZQXS55Q .

fenggang12 commented 3 years ago

image Yeah. I used the 30 seconds wavs. And I got the same results. Like the picture, "Try again the sound...."

suhani-kashyap commented 2 years ago

I had a lot of trouble with this, but it finally worked out in the end. Here's what a friend suggested I do.

Myprosody only seems to work with Python 3.7 (as it says very clearly in the README document). So, I uninstalled Python 3.9 from my Mac and installed python 3.7 on it. Then I created a virtual environment, in which I proceeded to download myprosody. It worked for me then.

Hope this helps! I've attached a screenshot of my output.

Screen Shot 2022-08-16 at 4 21 40 PM