mirror of https://github.com/coqui-ai/TTS.git
Update
This commit is contained in:
parent
87bb01a42b
commit
90cb358424
|
@ -47,7 +47,7 @@ def string2filename(string):
|
||||||
def get_audio_size(audiopath):
|
def get_audio_size(audiopath):
|
||||||
extension = audiopath.rpartition(".")[-1].lower()
|
extension = audiopath.rpartition(".")[-1].lower()
|
||||||
if extension not in {"mp3", "wav", "flac"}:
|
if extension not in {"mp3", "wav", "flac"}:
|
||||||
raise RuntimeError(f"The audio format {extension} is not supported, please convert the audio files for mp3, flac or wav format!")
|
raise RuntimeError(f"The audio format {extension} is not supported, please convert the audio files to mp3, flac, or wav format!")
|
||||||
|
|
||||||
audio_info = mutagen.File(audiopath).info
|
audio_info = mutagen.File(audiopath).info
|
||||||
return int(audio_info.length * audio_info.sample_rate)
|
return int(audio_info.length * audio_info.sample_rate)
|
||||||
|
|
Loading…
Reference in New Issue