OpenVoice icon indicating copy to clipboard operation
OpenVoice copied to clipboard

Failed to process mp3 file

Open lemuriandezapada opened this issue 1 year ago • 2 comments

Trying to run demo_part3. Simply replaced the mp3 with a different one containing some speech and the se_extractor just fails. Ideas as to why?

`NotImplementedError Traceback (most recent call last) Cell In[6], line 3 1 '' 2 reference_speaker = 'resources/20-1 [vocals].mp3' # This is the voice you want to clone ----> 3 target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=False)

File ~/repos/OpenVoice/openvoice/se_extractor.py:150, in get_se(audio_path, vc_model, target_dir, vad) 148 audio_segs = glob(f'{wavs_folder}/*.wav') 149 if len(audio_segs) == 0: --> 150 raise NotImplementedError('No audio segments found!') 152 return vc_model.extract_se(audio_segs, se_save_path=se_path), audio_name

NotImplementedError: No audio segments found!`

lemuriandezapada avatar Sep 18 '24 05:09 lemuriandezapada

Hello, @lemuriandezapada! I'm here to help you with any issues you're facing. Let's work together to solve this problem!

The se_extractor fails with a NotImplementedError because no audio segments were found in the wavs_folder. This can happen if the mp3 file does not meet the specific requirements for segmentation. Ensure that the mp3 file:

  1. Contains clear speech.
  2. Has segments longer than 1.5 seconds and shorter than 20 seconds.
  3. Produces text segments between 2 and 200 characters when processed.

Additionally, try setting the vad parameter to True:

target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=True)

This might help in successfully processing the mp3 file [1][2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 18 '24 05:09 dosubot[bot]

Step-by-Step Debugging and Fixing:

  1. Check if WAVs are Generated

2.Manually Convert MP3 to WAV

3.Fix Audio Segmentation

  1. Dependencies: sudo apt install ffmpeg # Ubuntu/Linux
    brew install ffmpeg # macOS
    choco install ffmpeg # Windows

5.Final Steps: If you identify the bug, modify se_extractor.py and test with different MP3 files. Submit your fix as a pull request to the OpenVoice repo.

Gokulramms avatar Feb 07 '25 06:02 Gokulramms