I'm hooking into IAudioClient and IAudioRenderClient to retrieve the raw audio buffer. To determine the format I call GetMixFormat on the client before. This works fine for most applications like games or Flash Player in Firefox.
However, audio captured from Google Chrome (Flash) is distorted. I've attached a short sample of the same audio stream captured from Firefox and Google Chrome. GetMixFormat() reports IEEE_FLOAT, 2 channels at 48k for both. But when importing them in Audacity and using those parameters, only the Firefox one plays well. In fact, to get the graph looking correctly on the Chrome one, I have to import it as Signed PCM (still distorted though).
Any ideas why GetMixFormat is wrong or what format the Google Chrome snippet is using?
As a side note, I found out that the Chrome sample contains 1 full frame (0xF00 bytes) and then only half a frame (0x780 bytes) and the rest filled with zeros, even though the functions report to have written 0xF00 bytes. But even when removing that zero data, I can't get anywhere. Is Chrome somehow altering the buffer?
Files:
- http://lms-dev.com/files/so/audio_ff.raw
- http://lms-dev.com/files/so/audio_chrome.raw
- http://lms-dev.com/files/so/audio_chrome_skip_empty_frame.raw
Any help is much appreciated! Thanks in advance.