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

mysplev doesn't work #16

Closed Soha85 closed 3 years ago

Soha85 commented 3 years ago

I converted mp3 to wav files 48k frame rate Here is converter code : from pydub import AudioSegment AudioSegment.converter = r"C:\ffmpeg\bin\ffmpeg.exe" import os lst=os.listdir("mp3") for f in lst: try: src=os.path.abspath('mp3\'+str(f)) dest=os.path.abspath('wav')+'\'+str(f.split('.')[0])+'.wav' sound = AudioSegment.from_mp3(src) sound=sound.set_frame_rate(48000) sound=sound.set_sample_width(4) sound.export(dest, format="wav") print(f,"is converted") except: print(f,"is not converted")

Then I use myprosody to analyze wav files Here is the code:

import myprosody as mysp import pickle import os lst=os.listdir("wav") for f in lst: if (f.endswith("wav")): print(f) try: p=str(f).split('.')[0] c=r"myprosody" mysp.myspgend(p,c) mysp.myspsyl(p,c) mysp.mysppaus(p,c) mysp.myspsr(p,c) mysp.myspatc(p,c) mysp.myspst(p,c) mysp.myspod(p,c) mysp.myspbala(p,c) mysp.myspf0mean(p,c) mysp.myspf0sd(p,c) mysp.myspf0med(p,c) mysp.myspf0min(p,c) mysp.myspf0max(p,c) mysp.myspf0q25(p,c) mysp.myspf0q75(p,c) mysp.mysppron(p,c) mysp.myprosody(p,c) mysp.mysplev(p,c) except Exception as e: print(str(e))

The error is:

for example: « appendInfoLine:1.3742569444444444,tab$,' Script line 866 not performed or completed: « appendInfoLine:'avepauseduratin',tab$,'avelongpause',tab$,'speakingtot:2',tab$,'avenumberofwords',tab$,'articulationrate',tab$,'inpro',tab$,'f1norm',tab$,'mr',tab$,'q25',tab$,'q50',tab$,'q75', tab$, 'std',tab$,'fmax',tab$,'fmin',tab$,'vowelinx1',tab$,'vowelinx2',tab$,'formantmean',tab$,'formantstd',tab$,'nuofwrds:0',tab$,'npause',tab$,'ins',tab$,'fillerratio',tab$,'xx',tab$,xxx$,tab$,'totsco',tab$,xxban$,tab$,'speakingrate' »

second: can you return values from functions, not just printing it while runtime?

OS: Windows 10 python 3.7 (32 bit)

Shahabks commented 3 years ago

For pickle, I suppose you need to train the main model again on their local machine ....... some of the users ran into the same issue and they re-trained the main model locally