I want to take uncompressed audio frames (Loopback Recording) and save it to an encoded file. I tried to use the AudioGraph
API.
I was hoping if AudioGraph.PrimaryRenderDevice
was null
then the Quantums would only fire when the AudioFrameInputNode
queued up enough samples for a quantum.
What instead happens is that the Quantums fire synchronously (the normal period is around 10,000 microseconds)
Quantum peroid 180 microseconds
Quantum peroid 202 microseconds
Quantum peroid 171 microseconds
Quantum peroid 134 microseconds
Quantum peroid 111 microseconds
Quantum peroid 132 microseconds
Quantum peroid 164 microseconds
Quantum peroid 183 microseconds
Quantum peroid 209 microseconds
Quantum peroid 220 microseconds
Quantum peroid 317 microseconds
Quantum peroid 355 microseconds
Quantum peroid 321 microseconds
Quantum peroid 140 microseconds
The AudioGraph
just synthesises silence when the AudioFrameInputNode
doesn't have any samples. Is there anyway to get around this? Is the answer just to use Media Foundation for transcoding raw frames to a file? I could use MediaStreamSource
but the api is pull based so I would have to buffer frames.