Switch to 32-bit floating point audio

Excluding Steam Link due to CPU and API limitations
This commit is contained in:
Cameron Gutman
2024-07-17 20:37:50 -05:00
parent 8ac378f467
commit 7f009a4b8e
8 changed files with 69 additions and 17 deletions
+15
View File
@@ -25,4 +25,19 @@ public:
// 4 - Surround Left
// 5 - Surround Right
}
enum class AudioFormat {
Sint16NE, // 16-bit signed integer (native endian)
Float32NE, // 32-bit floating point (native endian)
};
virtual AudioFormat getAudioBufferFormat() = 0;
int getAudioBufferSampleSize() {
switch (getAudioBufferFormat()) {
case IAudioRenderer::AudioFormat::Sint16NE:
return sizeof(short);
case IAudioRenderer::AudioFormat::Float32NE:
return sizeof(float);
}
}
};