NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

MediaFoundationResampler "The callee is currently not accepting further input"

Open Vivelin opened this issue 3 years ago • 0 comments

I am using the MediaFoundationResampler to resample audio on-the-fly so I can concatenate multiple audio sources into a single provider.

I figured out that to provide fast seeking, I need to call Reposition() on the MediaFoundationResampler. This seems to work fine.

Seeking too much, too quickly, however, seems to throw a COM exception:

System.Runtime.InteropServices.COMException (0xC00D36B5): The callee is currently not accepting further input. (0xC00D36B5) at NAudio.MediaFoundation.IMFTransform.ProcessInput(Int32 dwInputStreamId, IMFSample pSample, Int32 dwFlags) at NAudio.MediaFoundation.MediaFoundationTransform.Read(Byte[] buffer, Int32 offset, Int32 count) at NAudio.Wave.SampleProviders.WaveToSampleProvider.Read(Single[] buffer, Int32 offset, Int32 count) [...]

This seems to be something you expected, as MediaFoundationTransform.cs shows:

// give the input to the resampler
// can get MF_E_NOTACCEPTING if we didn't drain the buffer properly
transform.ProcessInput(0, sample, 0);

I'm not entirely sure what I could do about this from my end. The WdlResamplingSampleProvider seems to be working just fine for me so I can continue my work, but I figured this was worth reporting.

Vivelin avatar Sep 17 '21 16:09 Vivelin