Skip to content

Commit

Permalink
server : ffmpeg overwrite leftover temp file (#2431)
Browse files Browse the repository at this point in the history
* 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 0079740.

* Flag to force ffmpeg to overwrite output file if it exists
  • Loading branch information
gilbertgong authored Oct 2, 2024
1 parent 2ef717b commit ede1718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ 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";
cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1";
cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -y -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1";
std::string cmd = cmd_stream.str();

int status = std::system(cmd.c_str());
Expand Down

0 comments on commit ede1718

Please sign in to comment.