mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 15:00:30 +02:00
Windows: Capture the microphone through WASAPI instead of Media Foundation
Windows now uses the same host interface as SDL and iOS: sceUsbMic sends startRecording/stopRecording/deviceChanged, and drains buffered input on the CPU thread with pollRecording. A capture thread asks WASAPI for mono 16-bit at the game's rate (it converts from the mix format, so no more ffmpeg resampling), and copies packets into a lock-free ring buffer. It reopens the device when the selection changes, and retries once a second if the device is missing or gets unplugged. The device list comes from the active capture endpoints. Their friendly names are the ones Media Foundation reported, so existing MicDevice settings still match. An empty setting, now selectable as Auto like on SDL, means the default capture device. The Media Foundation audio capture code is removed; the camera still uses it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5071ffa22d
commit
3656fb46e2
12 files changed
+376
-279
No files matched your search
@@ -947,7 +947,6 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
|
||||
#if defined(_WIN32) && !PPSSPP_PLATFORM(UWP)
|
||||
if (IsWin7OrHigher()) {
|
||||
winCamera = new WindowsCaptureDevice(CAPTUREDEVICE_TYPE::VIDEO);
|
||||
winMic = new WindowsCaptureDevice(CAPTUREDEVICE_TYPE::AUDIO);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1078,11 +1077,6 @@ void NativeShutdownGraphics(GraphicsContext *graphicsContext) {
|
||||
delete winCamera;
|
||||
winCamera = nullptr;
|
||||
}
|
||||
if (winMic) {
|
||||
winMic->waitShutDown();
|
||||
delete winMic;
|
||||
winMic = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PPSSPP_PLATFORM(IOS)
|
||||
|
||||
Reference in new issue
Block a user