remove the goto's from the source code (came from http://github.com/thestk/stk toolkit)
add test wav file
This commit is contained in:
@@ -153,14 +153,15 @@ bool b3WriteWavFile::setWavFile(std::string fileName, int sampleRate, int numCha
|
||||
|
||||
char data[4] = {'d', 'a', 't', 'a'};
|
||||
int dataSize = 0;
|
||||
if (fwrite(&hdr, 1, bytesToWrite, m_data->m_file) != bytesToWrite) goto error;
|
||||
if (fwrite(&data, 4, 1, m_data->m_file) != 1) goto error;
|
||||
if (fwrite(&dataSize, 4, 1, m_data->m_file) != 1) goto error;
|
||||
|
||||
if (fwrite(&hdr, 1, bytesToWrite, m_data->m_file) != bytesToWrite)
|
||||
return false;
|
||||
if (fwrite(&data, 4, 1, m_data->m_file) != 1)
|
||||
return false;
|
||||
if (fwrite(&dataSize, 4, 1, m_data->m_file) != 1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
return false;
|
||||
}
|
||||
|
||||
void b3WriteWavFile::closeWavFile()
|
||||
|
||||
Reference in New Issue
Block a user