felrock commited on
Commit
3217f72
·
unverified ·
1 Parent(s): 456ddab

Close file after writing in server application (#1533)

Browse files

Fix of mistake leaving file open while reading it again as wav

Files changed (1) hide show
  1. examples/server/server.cpp +1 -0
examples/server/server.cpp CHANGED
@@ -456,6 +456,7 @@ int main(int argc, char ** argv) {
456
  // write file to temporary file
457
  std::ofstream temp_file{filename, std::ios::binary};
458
  temp_file << audio_file.content;
 
459
 
460
  // read wav content into pcmf32
461
  if (!::read_wav(filename, pcmf32, pcmf32s, params.diarize)) {
 
456
  // write file to temporary file
457
  std::ofstream temp_file{filename, std::ios::binary};
458
  temp_file << audio_file.content;
459
+ temp_file.close();
460
 
461
  // read wav content into pcmf32
462
  if (!::read_wav(filename, pcmf32, pcmf32s, params.diarize)) {