Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ class SplitWavAudioMubin():
|
|
14 |
self.filename = filename
|
15 |
self.filepath = folder + '/' + filename
|
16 |
|
17 |
-
self.audio = AudioSegment.
|
18 |
|
19 |
def get_duration(self):
|
20 |
return self.audio.duration_seconds
|
@@ -48,11 +48,11 @@ if uploaded_file is not None:
|
|
48 |
Path("./small").mkdir(parents=True, exist_ok=True)
|
49 |
length_audio = librosa.get_duration(filename=uploaded_file.name)/60
|
50 |
|
51 |
-
# convert to
|
52 |
format_ = uploaded_file.name.split('.')[-1]
|
53 |
-
outputname = uploaded_file.name + ".
|
54 |
sound = AudioSegment.from_file(uploaded_file,format=format_)
|
55 |
-
sound.export(outputname, format="
|
56 |
|
57 |
st.title("Audio2Many")
|
58 |
st.write('δΈε
±ζ', round(length_audio, 2) , "ει")
|
|
|
14 |
self.filename = filename
|
15 |
self.filepath = folder + '/' + filename
|
16 |
|
17 |
+
self.audio = AudioSegment.from_mp3(self.filepath)
|
18 |
|
19 |
def get_duration(self):
|
20 |
return self.audio.duration_seconds
|
|
|
48 |
Path("./small").mkdir(parents=True, exist_ok=True)
|
49 |
length_audio = librosa.get_duration(filename=uploaded_file.name)/60
|
50 |
|
51 |
+
# convert to mp3
|
52 |
format_ = uploaded_file.name.split('.')[-1]
|
53 |
+
outputname = uploaded_file.name + ".mp3"
|
54 |
sound = AudioSegment.from_file(uploaded_file,format=format_)
|
55 |
+
sound.export(outputname, format="mp3")
|
56 |
|
57 |
st.title("Audio2Many")
|
58 |
st.write('δΈε
±ζ', round(length_audio, 2) , "ει")
|