- make the audio file writer easier to debug

This commit is contained in:
Dmytro Bogovych 2025-01-24 12:53:06 +03:00
parent 6fef519a4b
commit cedc44e24c
1 changed files with 4 additions and 2 deletions

View File

@ -325,11 +325,13 @@ bool WavFileWriter::open(const std::tstring& filename, int rate, int channels)
#ifdef WIN32
mHandle = _wfopen(filename.c_str(), L"wb");
#else
mHandle = fopen(strx::makeUtf8(filename).c_str(), "wb");
auto filename_utf8 = strx::makeUtf8(filename);
mHandle = fopen(filename_utf8.c_str(), "wb");
#endif
if (nullptr == mHandle)
{
ICELogError(<< "Failed to create .wav file: filename = " << strx::makeUtf8(filename) << " , error = " << errno);
int errorcode = errno;
ICELogError(<< "Failed to create .wav file: filename = " << strx::makeUtf8(filename) << " , error = " << errorcode);
return false;
}