I am using the Windows AudioGraph APIs to generate, and conditionally mix with an input device, app generated audio and write it to an output file.
The graph is an AudioFrameInputNode and zero or more AudioDeviceInputNodes connected to an AudioSubmixNode, which is then connected to an AudioFileOutputNode.
The app generates AudioFrames and adds them to the AudioFrameInputNode so they can be mixed with any mics that are selected by the user (if any), and the final output written to (.m4a) file.
I have run into an issue where if no input devices are being mixed into the node, the graph doesn't seem to process any frames from the AudioFrameInputNode. After 64 frames are inserted, attempting to add more throws an error that there are "Too many input frames", as documented on the AudioFrameInputNode docs.
I recall running into this issue once before but don't remember how exactly I fixed/worked around it. I think it required me to add an AudioDeviceOutputNode with OutgoingGain set to 0.0, but I'd like to avoid this extra undesired processing if possible.
Update:
I tried adding an AudioOutputDeviceNode with an OutgoingGain of both 0.0f and 1.0f and in neither case did the graph behave as expected. After a short time I still see the console output being spammed with
Exception thrown at 0x00007FF9C211F39C (KernelBase.dll) in app.exe: WinRT originate error - 0x8000000E : 'Too many queued frames'. Exception thrown at 0x00007FF9C211F39C in app.exe: Microsoft C++ exception: winrt::hresult_illegal_method_call at memory location 0x000000F91983EA98.
When trying to call AddFrame on the AudioFrameInputNode. The output file is also the correct length but contains only silence.
I checked and I see that the AudioFrameInputNode is firing the QuantumStarted event, though once sufficient frames are enqueued the requested bytes is 0.
I also tested the scenario where I am also capturing a mic input via AudioDeviceInputNode and when there is a capture device outputting to the AudioSubmixNode the output file appears to have the complete sound.
It seems like when there is no input device to the AudioSubmixNode it isn't consuming/processing frames from the AudioFrameInputNode for some reason.