From 00797403bd43ebcb1e0678989a4fc676d417b4af Mon Sep 17 00:00:00 2001 From: Gilbert Gong Date: Wed, 25 Sep 2024 16:11:51 -0700 Subject: [PATCH] Remove possible leftover ffmpeg temp file from a previous failed conversion --- examples/server/server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 60b96d49..cfbed21c 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -219,6 +219,8 @@ void check_ffmpeg_availibility() { bool convert_to_wav(const std::string & temp_filename, std::string & error_resp) { std::ostringstream cmd_stream; std::string converted_filename_temp = temp_filename + "_temp.wav"; + // Remove possible leftover ffmpeg temp file from a previous failed conversion + remove(converted_filename_temp.c_str()); cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1"; std::string cmd = cmd_stream.str();