andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 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_VOICE_ENGINE_VOE_FILE_IMPL_H |
| 12 | #define WEBRTC_VOICE_ENGINE_VOE_FILE_IMPL_H |
| 13 | |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/voice_engine/include/voe_file.h" |
| 15 | #include "webrtc/voice_engine/shared_data.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | class VoEFileImpl : public VoEFile |
| 20 | { |
| 21 | public: |
| 22 | // Playout file locally |
| 23 | |
| 24 | virtual int StartPlayingFileLocally( |
| 25 | int channel, |
| 26 | const char fileNameUTF8[1024], |
| 27 | bool loop = false, |
| 28 | FileFormats format = kFileFormatPcm16kHzFile, |
| 29 | float volumeScaling = 1.0, |
| 30 | int startPointMs = 0, |
| 31 | int stopPointMs = 0); |
| 32 | |
| 33 | virtual int StartPlayingFileLocally( |
| 34 | int channel, |
| 35 | InStream* stream, |
| 36 | FileFormats format = kFileFormatPcm16kHzFile, |
| 37 | float volumeScaling = 1.0, |
| 38 | int startPointMs = 0, int stopPointMs = 0); |
| 39 | |
| 40 | virtual int StopPlayingFileLocally(int channel); |
| 41 | |
| 42 | virtual int IsPlayingFileLocally(int channel); |
| 43 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 44 | // Use file as microphone input |
| 45 | |
| 46 | virtual int StartPlayingFileAsMicrophone( |
| 47 | int channel, |
| 48 | const char fileNameUTF8[1024], |
| 49 | bool loop = false , |
| 50 | bool mixWithMicrophone = false, |
| 51 | FileFormats format = kFileFormatPcm16kHzFile, |
| 52 | float volumeScaling = 1.0); |
| 53 | |
| 54 | virtual int StartPlayingFileAsMicrophone( |
| 55 | int channel, |
| 56 | InStream* stream, |
| 57 | bool mixWithMicrophone = false, |
| 58 | FileFormats format = kFileFormatPcm16kHzFile, |
| 59 | float volumeScaling = 1.0); |
| 60 | |
| 61 | virtual int StopPlayingFileAsMicrophone(int channel); |
| 62 | |
| 63 | virtual int IsPlayingFileAsMicrophone(int channel); |
| 64 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 65 | // Record speaker signal to file |
| 66 | |
| 67 | virtual int StartRecordingPlayout(int channel, |
| 68 | const char* fileNameUTF8, |
| 69 | CodecInst* compression = NULL, |
| 70 | int maxSizeBytes = -1); |
| 71 | |
| 72 | virtual int StartRecordingPlayout(int channel, |
| 73 | OutStream* stream, |
| 74 | CodecInst* compression = NULL); |
| 75 | |
| 76 | virtual int StopRecordingPlayout(int channel); |
| 77 | |
| 78 | // Record microphone signal to file |
| 79 | |
| 80 | virtual int StartRecordingMicrophone(const char* fileNameUTF8, |
| 81 | CodecInst* compression = NULL, |
| 82 | int maxSizeBytes = -1); |
| 83 | |
| 84 | virtual int StartRecordingMicrophone(OutStream* stream, |
| 85 | CodecInst* compression = NULL); |
| 86 | |
| 87 | virtual int StopRecordingMicrophone(); |
| 88 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 89 | protected: |
| 90 | VoEFileImpl(voe::SharedData* shared); |
| 91 | virtual ~VoEFileImpl(); |
| 92 | |
| 93 | private: |
| 94 | voe::SharedData* _shared; |
| 95 | }; |
| 96 | |
| 97 | } // namespace webrtc |
| 98 | |
| 99 | #endif // WEBRTC_VOICE_ENGINE_VOE_FILE_IMPL_H |