MCPcopy Create free account
hub / github.com/audacity/audacity / write

Method write

lib-src/soundtouch/source/SoundStretch/WavFile.cpp:793–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791
792
793void WavOutFile::write(const unsigned char *buffer, int numElems)
794{
795 int res;
796
797 if (header.format.bits_per_sample != 8)
798 {
799 ST_THROW_RT_ERROR("Error: WavOutFile::write(const char*, int) accepts only 8bit samples.");
800 }
801 assert(sizeof(char) == 1);
802
803 res = (int)fwrite(buffer, 1, numElems, fptr);
804 if (res != numElems)
805 {
806 ST_THROW_RT_ERROR("Error while writing to a wav file.");
807 }
808
809 bytesWritten += numElems;
810}
811
812
813

Callers 1

processFunction · 0.45

Calls 5

_swap16BufferFunction · 0.85
saturateFunction · 0.85
_swap16Function · 0.85
_swap32Function · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected