Skip to content

Commit

Permalink
use tmp name
Browse files Browse the repository at this point in the history
  • Loading branch information
teejae committed Sep 16, 2024
1 parent 049b3a0 commit 3adade3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ int main(int argc, char ** argv) {
if (sparams.ffmpeg_converter) {
// if file is not wav, convert to wav
// write to temporary file
const std::string temp_filename = "whisper_server_temp_file.wav";
std::string new_temp_filename_base = std::tmpnam(nullptr);
const std::string temp_filename = new_temp_filename_base + ".wav";
std::ofstream temp_file{temp_filename, std::ios::binary};
temp_file << audio_file.content;
temp_file.close();
Expand Down

0 comments on commit 3adade3

Please sign in to comment.