Shahabks / my-voice-analysis

My-Voice Analysis is a Python library for the analysis of voice (simultaneous speech, high entropy) without the need of a transcription. It breaks utterances and detects syllable boundaries, fundamental frequency contours, and formants.
https://shahabks.github.io/my-voice-analysis/
MIT License
297 stars 91 forks source link

parselmouth.PraatError: Unknown variable: #1

Closed codeundercoverdev closed 5 years ago

codeundercoverdev commented 5 years ago

This llibrary looks awesome! I'm trying to repeat the first example locally.

I created a folder called my-voice-analysis/Mysp and placed the myspsolution.praat file in that folder and a wav file called about_time.wav that is a 4 second clip of a man speaking. From the my-voice-analysis firectory, I try running:

mysp=__import__("my-voice-analysis")
p="about_time" # Audio File title
c = r"Mysp"
mysp.myspgend(p,c)

I get the following error:

>>> mysp.myspgend(p,c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/envs/conda3/lib/python3.7/site-packages/my-voice-analysis/__init__.py", line 231, in myspgend
    objects= run_file(sourcerun, -20, 2, 0.3, "yes",sound,path, 80, 400, 0.01, capture_output=True)
parselmouth.PraatError: Unknown variable:
« (ln(f_one
Script line 295 not performed or completed:
« lnf0 = (ln(f_one)-5.65)/0.31 »
Script not completed.

Any idea? Thanks!

Shahabks commented 5 years ago

Please put down the path to the directory as c=r"C:/user/.../myspsolution.praat" another possibility, if your audio contents background noise the file won't be analysed.

Please let me know if you run again into problems.....I will fix the background noise problem and other fixations to make it easy to use

Shahabks commented 5 years ago

@codeundercoverdev Please put down the path to the directory as c=r"C:/user/.../myspsolution.praat" another possibility, if your audio contents background noise the file won't be analysed.

I revised myspsolution.praat and my-voice-analysis at pypi ....please consider to download the formar one and upgrade you my-voice-analysis from pypi.

Please let me know if you run again into problems.....I will fix the background noise problem and other fixations to make it easy to use

codeundercoverdev commented 5 years ago

Hi @Shahabks , I am using a Mac, so there is no c drive. The file should be targeted correctly with the code I have. Also, there is no background noise in the file. Any ideas?

codeundercoverdev commented 5 years ago

oh, didn't see your second message. I'll try upgrading and let you know.

Shahabks commented 5 years ago

hi @codeundercoverdev I would suggest you add the following two line codes

[in] my=import("my-voice-analysis")

Add the following two lines

   p=input("enter the path to the dataset:   ")     
                              #then copy/paste   C:\Users\Desktop\dataset\
   m=input("enter the audio file name:    ")   # the audio fiile name without extention 

  my.mysppaus(m,p)
  my.myspsr(m,p)
  my.myspatc(m,p)
  my.myspst(m,p)
  my.myspod(m,p)
  my.myspbala(m,p)
  my.myspf0mean(m,p)
  my.myspf0sd(m,p)
 my.myspf0med(m,p)
 my.myspf0min(m,p)
 my.myspf0max(m,p)
my.myspf0q25(m,p)
 my.myspf0q75(m,p)
 my.mysptotal(m,p)
 my.mysppron(m,p)
 my.myspgend(m,p)

[out] ================= RESTART: C:\Users\ta\Desktop\myvoiceee.py ================= enter the path to the dataset: C:\Users\ta\Desktop\testasr\dataset\audioFiles enter the audio file name: sound [] number_ of_syllables= 66 [] number_of_pauses= 2 [] rate_of_speech= 3 # syllables/sec original duration [] articulation_rate= 4 # syllables/sec speaking duration [] speaking_duration= 17.7 # sec only speaking duration without pauses [] original_duration= 19.6 # sec total speaking duration with pauses [] balance= 0.9 # ratio (speaking duration)/(original duration) [] f0_mean= 146.83 # Hz global mean of fundamental frequency distribution [] f0_SD= 18.95 # Hz global standard deviation of fundamental frequency distribution [] f0_MD= 145.0 # Hz global median of fundamental frequency distribution [] f0_min= 71 # Hz global minimum of fundamental frequency distribution [] f0_max= 237 # Hz global maximum of fundamental frequency distribution [] f0_quan25= 140 # Hz global 25th quantile of fundamental frequency distribution [] f0quan75= 153 # Hz global 75th quantile of fundamental frequency distribution [] 0 number of_syllables 66 number_of_pauses 2 rate_of_speech 3 articulation_rate 4 speaking_duration 17.7 original_duration 19.6 balance 0.9 f0_mean 146.83 f0_std 18.95 f0_median 145 f0_min 71 f0_max 237 f0_quantile25 140 f0_quan75 153 [] Pronunciation_posteriori_probability_score_percentage= :89.96 [] a Male, mood of speech: speaking passionately, p-value/sample size= :0.00 5

NOTE: if the audio file is not clear you will see the following message Try again the sound of the audio was not clear [the 3rd output]

I hope it works for you

Shahabks commented 5 years ago

@codeundercoverdev Hello Phil, have you tried the a/m algorithm? the issue fixed? I would be grateful if you let me know your latest experience

Shahabks commented 5 years ago

please rewrite your script as: [in]

after symbol "=" enter twice underline "__" and without any space, type

"import" and again without pace twice underline "" and then ("my-voice-analysis") my=import__("my-voice-analysis") p=input("Enter the path to the audio file:") m=input("Enter the audio file name:") ouut=my.mysppaus(m,p) print(ouut)

after running the script the followings will pop out: [out]

your machine ask

Enter the path to the audio file: (please enter the path) ...D:\Appshark\Projects\xxx\ Enter the audio file name: (please enter the audio file name without extension .wav) ... 25641692

that is it.

note: in some python versions you might need to get "input" command differently. Please let me know if you run into error again.

On Wed, 17 Apr 2019 at 01:09, Dr. Shiulee Chakraborty < notifications@github.com> wrote:

Getting an error Below is my script my=import("my-voice-analysis") p=input("D:\Appshark\Projects\xxx") m=input("D:\Appshark\Projects\xxx\25641692.wav") my.mysppaus(m,p)

File "", line 1 my=import("my-voice-analysis") ^ SyntaxError: invalid syntax

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Shahabks/my-voice-analysis/issues/1#issuecomment-483727721, or mute the thread https://github.com/notifications/unsubscribe-auth/Aad97oRyL5HpgHKbRrsHDUQlxaKEbA94ks5vhfXIgaJpZM4bJx2_ .

wil2210 commented 5 years ago

Hi @Shahabks, I am doing exactly what you have done up there but I cannot get pass through "Try again the sound of the audio was not clear". Is it linked to the quality of the file ? Although I doubt it because I use The Ryerson Audio-Visual Database of Emotional Speech and Song (RAVDESS) which are audio files of good quality.

Shahabks commented 5 years ago

Hello, could you please make sure

  1. the audio files are .wav.
  2. the length of recorded voice is 7 sec. +,
  3. Utterances without long fillers or very long pauses

If you still run into issues please let me have more information on the issue to help you

On Fri, 12 Jul 2019 at 00:51, wil2210 notifications@github.com wrote:

Hi @Shahabks https://github.com/Shahabks, I am doing exactly what you have done up there but I cannot get pass through "Try again the sound of the audio was not clear". Is it linked to the quality of the file ? Although I doubt it because I use The Ryerson Audio-Visual Database of Emotional Speech and Song (RAVDESS) which are audio files of good quality.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Shahabks/my-voice-analysis/issues/1?email_source=notifications&email_token=AGTX33VW3JNEMPRPMZ73A33P65JGZA5CNFSM4GZHDW72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXEO6Q#issuecomment-510543738, or mute the thread https://github.com/notifications/unsubscribe-auth/AGTX33T6DROY5NI2JQTUUDDP65JGZANCNFSM4GZHDW7Q .

willianbs commented 4 years ago

Same issue here, tried everything :/ Any updates on this @Shahabks or @wil2210 ?

Shahabks commented 4 years ago

could you please send me your code as well as the audio file you wish to analyse? I check on it

On Tue, 19 Nov 2019 at 06:04, Will Silveira notifications@github.com wrote:

Same issue here, tried everything :/ Any updates on this @Shahabks https://github.com/Shahabks or @wil2210 https://github.com/wil2210 ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Shahabks/my-voice-analysis/issues/1?email_source=notifications&email_token=AGTX33RLOAZ5MXQDBZWV5VDQUL7PNA5CNFSM4GZHDW72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEL45RY#issuecomment-555208391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTX33TEKOJZ6S5JNFU2XX3QUL7PNANCNFSM4GZHDW7Q .

Shahabks commented 4 years ago

Sorry Will, my access to the dropbox of yours is denied ..... perhaps it something about my system setup.......could you send them here, gmail

On Tue, 19 Nov 2019 at 09:46, Will Silveira notifications@github.com wrote:

@Shahabks https://github.com/Shahabks Here it is: https://www.dropbox.com/s/da97dh0jcwnip0s/voice-analysis.zip?dl=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Shahabks/my-voice-analysis/issues/1?email_source=notifications&email_token=AGTX33WVQNWR2B3CWOL7YBLQUMZPXA5CNFSM4GZHDW72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEMODVA#issuecomment-555278804, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTX33Q7CDW4HHTLTA3FD4DQUMZPXANCNFSM4GZHDW7Q .

willianbs commented 4 years ago

@Shahabks Send failed. which e-mail? shahabks@gmail does not work :/

willianbs commented 4 years ago

Nevermind, reinstalled all and managed it to work :) Thanks!