1 /*
2  *  Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_FACTORY_H
12 #define WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_FACTORY_H
13 
14 #include "webrtc/common_types.h"
15 
16 namespace webrtc {
17 
18 class FileAudioDevice;
19 
20 // This class is used by audio_device_impl.cc when WebRTC is compiled with
21 // WEBRTC_DUMMY_FILE_DEVICES. The application must include this file and set the
22 // filenames to use before the audio device module is initialized. This is
23 // intended for test tools which use the audio device module.
24 class FileAudioDeviceFactory {
25  public:
26   static FileAudioDevice* CreateFileAudioDevice(const int32_t id);
27 
28   // The input file must be a readable 48k stereo raw file. The output
29   // file must be writable. The strings will be copied.
30   static void SetFilenamesToUse(const char* inputAudioFilename,
31                                 const char* outputAudioFilename);
32 
33  private:
34   static const uint32_t MAX_FILENAME_LEN = 256;
35   static bool _isConfigured;
36   static char _inputAudioFilename[MAX_FILENAME_LEN];
37   static char _outputAudioFilename[MAX_FILENAME_LEN];
38 };
39 
40 }  // namespace webrtc
41 
42 #endif  // WEBRTC_AUDIO_DEVICE_FILE_AUDIO_DEVICE_FACTORY_H
43