REVIEWED: QOA audio file export
This commit is contained in:
parent
ab14ad5d75
commit
9614d3353b
1 changed files with 10 additions and 6 deletions
16
src/raudio.c
16
src/raudio.c
|
@ -1003,13 +1003,17 @@ bool ExportWave(Wave wave, const char *fileName)
|
||||||
#if defined(SUPPORT_FILEFORMAT_QOA)
|
#if defined(SUPPORT_FILEFORMAT_QOA)
|
||||||
else if (IsFileExtension(fileName, ".qoa"))
|
else if (IsFileExtension(fileName, ".qoa"))
|
||||||
{
|
{
|
||||||
qoa_desc qoa = { 0 };
|
if (wave.sampleSize == 16)
|
||||||
qoa.channels = wave.channels;
|
{
|
||||||
qoa.samplerate = wave.sampleRate;
|
qoa_desc qoa = { 0 };
|
||||||
qoa.samples = wave.frameCount;
|
qoa.channels = wave.channels;
|
||||||
|
qoa.samplerate = wave.sampleRate;
|
||||||
|
qoa.samples = wave.frameCount;
|
||||||
|
|
||||||
// TODO: Review wave.data format required for export
|
int bytesWritten = qoa_write(fileName, wave.data, &qoa);
|
||||||
success = qoa_write(fileName, wave.data, &qoa);
|
if (bytesWritten > 0) success = true;
|
||||||
|
}
|
||||||
|
else TRACELOG(LOG_WARNING, "AUDIO: Wave data must be 16 bit per sample for QOA format export");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (IsFileExtension(fileName, ".raw"))
|
else if (IsFileExtension(fileName, ".raw"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue