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