Makes the WebRTC fake device capable of playing audio from a file.
The purpose of this patch is to be able to do advanced audio testing,
such as AGC testing and (if possible) AEC testing.
The patch adds a new flag --use-file-for-fake-audio-capture, similar
to --use-file-for-fake-video-capture on the video side. It takes as
argument a file to play back on the fake devices instead of the default
generated beep sound. The new flag is to be used together with
--use-fake-devices-for-media-stream (if the new flag isn't specified,
the former flag will play beep sounds as usual).
I think adding a new flag makes sense for now, but we could look at
coalescing these flags in a later patch since more flags = bad.
As for the implementation, I considered creating a new file fake
input stream on the side of the old one, and have audio_manager_base.cc
choose between the two implementations depending on how the flags
were set. I ended up not doing since the two classes would have a lot
in common, notably all the timing code. Another option could be to
pull beeping/playing from file into a new abstraction which the fake
input call stream calls into. I think the current implementation is
reasonable though.
Also, this patch will require the audio file to be in exactly the same
format as the audio bus on the system. We may want to add resampling
support later if this turns out to be a problem on the bots.
Developed together with xians@.
BUG=421054
R=dalecurtis@chromium.org
Review URL: https://codereview.chromium.org/
734993002
Cr-Commit-Position: refs/heads/master@{#305195}