Spaces:
Sleeping
Sleeping
server : ffmpeg overwrite leftover temp file (#2431)
Browse files* Remove possible leftover ffmpeg temp file from a previous failed conversion
* Revert "Remove possible leftover ffmpeg temp file from a previous failed conversion"
This reverts commit 00797403bd43ebcb1e0678989a4fc676d417b4af.
* Flag to force ffmpeg to overwrite output file if it exists
examples/server/server.cpp
CHANGED
|
@@ -219,7 +219,7 @@ void check_ffmpeg_availibility() {
|
|
| 219 |
bool convert_to_wav(const std::string & temp_filename, std::string & error_resp) {
|
| 220 |
std::ostringstream cmd_stream;
|
| 221 |
std::string converted_filename_temp = temp_filename + "_temp.wav";
|
| 222 |
-
cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1";
|
| 223 |
std::string cmd = cmd_stream.str();
|
| 224 |
|
| 225 |
int status = std::system(cmd.c_str());
|
|
|
|
| 219 |
bool convert_to_wav(const std::string & temp_filename, std::string & error_resp) {
|
| 220 |
std::ostringstream cmd_stream;
|
| 221 |
std::string converted_filename_temp = temp_filename + "_temp.wav";
|
| 222 |
+
cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -y -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1";
|
| 223 |
std::string cmd = cmd_stream.str();
|
| 224 |
|
| 225 |
int status = std::system(cmd.c_str());
|