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:
some values in myprosody function raises out of range value
mysplev doesn't work
sometimes it raises error name "pickle" is not defined even I import pickle
sometimes its raise error symbol misplaced or unknownsymbol
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?
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
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:
some values in myprosody function raises out of range value
mysplev doesn't work sometimes it raises error name "pickle" is not defined even I import pickle sometimes its raise error symbol misplaced or unknownsymbol
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)