mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-15 03:20:08 +01:00
Repaired int-to-string conversion in exception message formatting
This commit is contained in:
parent
6b2befd571
commit
629a1bbc14
@ -48,6 +48,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <cstring>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
@ -283,10 +284,11 @@ int WavInFile::read(short *buffer, int maxElems)
|
||||
// 16 bit format
|
||||
if (header.format.bits_per_sample != 16)
|
||||
{
|
||||
string msg = "WAV file bits per sample format not supported: ";
|
||||
msg += (int)header.format.bits_per_sample;
|
||||
msg += " bits per sample.";
|
||||
throw runtime_error(msg);
|
||||
stringstream ss;
|
||||
ss << "\nOnly 8/16 bit sample WAV files supported. Can't open WAV file with ";
|
||||
ss << (int)header.format.bits_per_sample;
|
||||
ss << " bit sample format. ";
|
||||
throw runtime_error(ss.str());
|
||||
}
|
||||
|
||||
assert(sizeof(short) == 2);
|
||||
@ -711,10 +713,11 @@ void WavOutFile::write(const short *buffer, int numElems)
|
||||
|
||||
if (header.format.bits_per_sample != 16)
|
||||
{
|
||||
string msg = "WAV file bits per sample format not supported: ";
|
||||
msg += (int)header.format.bits_per_sample;
|
||||
msg += " bits per sample.";
|
||||
throw runtime_error(msg);
|
||||
stringstream ss;
|
||||
ss << "\nOnly 8/16 bit sample WAV files supported. Can't open WAV file with ";
|
||||
ss << (int)header.format.bits_per_sample;
|
||||
ss << " bit sample format. ";
|
||||
throw runtime_error(ss.str());
|
||||
}
|
||||
|
||||
// allocate temp buffer to swap byte order if necessary
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user