Integrate the new data converter into capture devices.

This commit is contained in:
David Reid
2020-02-02 11:54:22 +10:00
parent 9b34e686d5
commit 6cdd4c81fb
2 changed files with 445 additions and 440 deletions
+442 -440
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -31,6 +31,8 @@ void stop_callback(ma_device* pDevice)
void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount)
{
MA_ASSERT(pDevice->capture.format == pDevice->playback.format);
/* In this test the format and channel count are the same for both input and output which means we can just memcpy(). */
ma_copy_memory(pOutput, pInput, frameCount * ma_get_bytes_per_frame(pDevice->capture.format, pDevice->capture.channels));
@@ -117,6 +119,7 @@ int main(int argc, char** argv)
#if defined(OUTPUT_WAV) && OUTPUT_WAV==1
deviceConfig.pUserData = &wav;
#endif
deviceConfig.wasapi.noAutoConvertSRC = MA_TRUE;
ma_device device;
result = ma_device_init(&context, &deviceConfig, &device);