From c695a7eabbac4c3a0138b6eeb0e9005ff708f985 Mon Sep 17 00:00:00 2001 From: jackun Date: Sun, 21 Feb 2021 04:42:12 +0200 Subject: [PATCH] USB: usb-mic: send 1ms worth of samples for 48kHz and 8kHz sample rates --- pcsx2/USB/usb-mic/usb-mic-singstar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp index afb69a8473..4d1cd868e2 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp @@ -585,6 +585,11 @@ namespace usb_mic int16_t* dst = nullptr; std::vector dst_alloc(0); //TODO size_t len = p->iov.size; + + // send only 1ms (bInterval) of samples + if (s->f.srate[0] == 48000 || s->f.srate[0] == 8000) + len = std::min(p->iov.size, outChns * sizeof(int16_t) * s->f.srate[0] / 1000); + //Divide 'len' bytes between 2 channels of 16 bits uint32_t max_frames = len / (outChns * sizeof(uint16_t));