Retrieval-based-Voice-Conversion-WebUI
Retrieval-based-Voice-Conversion-WebUI copied to clipboard
RuntimeError: Failed to load audio: ffmpeg error (see stderr output for detail)
No spaces in the audio path, and it's a wav file. Could anybody help me ?
Traceback (most recent call last):
File "F:\Retrieval-based-Voice-Conversion-WebUI-updated0618v2\infer-web.py", line 178, in vc_single
audio = load_audio(input_audio_path, 16000)
File "F:\Retrieval-based-Voice-Conversion-WebUI-updated0618v2\my_utils.py", line 19, in load_audio
raise RuntimeError(f"Failed to load audio: {e}")
RuntimeError: Failed to load audio: ffmpeg error (see stderr output for detail)
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\routes.py", line 321, in run_predict
output = await app.blocks.process_api(
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\blocks.py", line 1007, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\blocks.py", line 953, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\components.py", line 2076, in postprocess
processing_utils.audio_to_file(sample_rate, data, file.name)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\processing_utils.py", line 206, in audio_to_file
data = convert_to_16_bit_wav(data)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gradio\processing_utils.py", line 219, in convert_to_16_bit_wav
if data.dtype in [np.float64, np.float32, np.float16]:
AttributeError: 'NoneType' object has no attribute 'dtype'
Same issue in Colab.
Same issue in Colab
same issue in colab
same issue building a docker image
did anyone find the solution. i am stuck
same issue
same issue
Can y'all test this and see if it works? Worked for me. :) https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/711#issue-1795198576
Does not work for me.
Same issue.
Hello, I got the same issue, but this error doesn't stop the training and after this the training continues
@Tomissugo and all the others, If you still have the error try to change the file's except block from
except Exception as e:
raise RuntimeError(f"Failed to load audio: {e}")`
into
except Exception as e:
print("stderr:", e.stderr.decode("utf8"))
raise RuntimeError(f"Failed to load audio: {e}")
It will give you more details about the real error. For my part it was a mistake in the name of the wav file
Hello. I had the same issue, and Onepierre was correct on how the system couldnt find the files. In my case, the the python was trying to read the DESKTOP.INI system file in the folder, but for some reason it was NOT matching the files that were in the folder. I deleted the DESKTOP.INI out of the input folder and everything worked fine then. No false/non existent files to fail on.
same thing on autodl. can't fix this
can't fix this need something else.
I just got this error, but the reason was the path was wrong, I had the parent folder and not the folder with the actual audio files.
so double check your path, and if that doesn't work try renaming them to have only letters
My filepath is correct. I am trying use it to transcribe using flask. I have the same error also.
my code is
app.py
from flask import Flask, render_template, redirect, request, url_for from flask_sqlalchemy import SQLAlchemy import whisper from werkzeug.utils import secure_filename import os
app = Flask(name) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///transcribe.db" db = SQLAlchemy(app) app.app_context().push()
class Transcription(db.Model): sno = db.Column(db.Integer, primary_key = True) text = db.Column(db.Text, nullable=False)
def __repr__(self) -> str:
return f"{self.sno} - {self.text}"
UPLOAD_FOLDER = r'D:\Flask\TextSummariser\FileAudio' app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
return '.' in filename and
filename.rsplit('.', 1)[1].lower() in {'mp3', 'wav'}
@app.route('/', methods=['GET', 'POST']) def file_upload(): if request.method == 'POST': # check if the post request has the file part if 'file' not in request.files: return redirect(request.url) file = request.files['file'] print(file.filename) # if user does not select file, browser also # submit an empty part without filename if file.filename == '': return redirect(request.url) print(allowed_file(file.filename)) if file and allowed_file(file.filename): filename = secure_filename(file.filename) file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) file_path = os.path.join(app.config['UPLOAD_FOLDER'], filename) file.save(file_path) print("File saved to:", file_path)
model = whisper.load_model("base")
print("Model loaded")
transcription_text = model.transcribe(file_path)
print("Transcription Completed")
transcription = Transcription(text=transcription_text)
db.session.add(transcription)
db.session.commit()
return redirect(url_for('uploaded_file', filename=filename))
return render_template('index.html')
@app.route('/uploads/{filename} uploaded successfully
'''
if name == 'main': app.run(debug=True)
index.html
<style>
.input-group-text{
display: flex;
justify-content: center;
align-items: center;
}
.custom-container {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 20px;
width: 400px;
text-align: center;
margin: auto;
margin-top: 50px;
}
.custom-heading {
margin-top: 0;
color: gray;
}
.custom-input-file {
margin: 20px 0;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f9f9f9;
width: 100%;
}
.custom-submit-btn {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.custom-submit-btn:hover {
background-color: #0056b3;
}
.custom-footer {
background-color: #212529;
padding: 10px 0;
position: fixed;
left: 20px;
bottom: 20px;
width: calc(100% - 40px);
color: white;
text-align: center;
display: flex;
justify-content: center;
}
</style>
<div class="custom-container">
<h2 class="custom-heading">Upload an Audio File</h2>
<form action="/" method="POST" enctype="multipart/form-data">
<div class="input-group">
<input type="file" name="file" class="custom-input-file" onchange="displayFileName(this)"
/>
<label class="input-group-text" for="file">Choose file</label>
</div>
<input type="submit" value="Upload" class="custom-submit-btn" />
</form>
</div>
<div class="custom-footer">
<p>Text Summariser by Team SSLP</p>
</div>
<script>
function displayFileName(input) {
const label = input.nextElementSibling;
const fileName = input.files[0].name;
label.innerText = fileName;
}
</script>
pls help.
The audio file is uploaded in the given flask directory but the transcription doesn't get to work. The model gets loaded but the audio file is not being loaded in the transcribe function
In my case, using sub directory under RVC as training folder (eg: ./content) solved this problem.
In my case, using sub directory under RVC as training folder (eg: ./content) solved this problem
I have the same issue with RVC, what do u mean by creating sub directory ?
For me it was because the audio file it was trying to read didn't exist.
This issue was closed because it has been inactive for 15 days since being marked as stale.