diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c index 0df5ba381..ad703b497 100644 --- a/src/hostapi/wdmks/pa_win_wdmks.c +++ b/src/hostapi/wdmks/pa_win_wdmks.c @@ -4734,6 +4734,12 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, { stream->capture.framesPerBuffer = stream->capture.pPin->frameSize; } + + if(stream->capture.framesPerBuffer == 0) { + /* WinRT devices will reject a zero RequestedBufferSize. See https://github.com/PortAudio/portaudio/issues/761 */ + stream->capture.framesPerBuffer = 1; + } + PA_DEBUG(("Input frames chosen:%ld\n",stream->capture.framesPerBuffer)); /* Setup number of packets to use */ @@ -4763,6 +4769,12 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, { stream->render.framesPerBuffer = stream->render.pPin->frameSize; } + + if(stream->render.framesPerBuffer == 0) { + /* WinRT devices will reject a zero RequestedBufferSize. See https://github.com/PortAudio/portaudio/issues/761 */ + stream->render.framesPerBuffer = 1; + } + PA_DEBUG(("Output frames chosen:%ld\n",stream->render.framesPerBuffer)); /* Setup number of packets to use */