blob: 5d28947ed785381bc34d41ee6dfdc011cb9e0078 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tommi@webrtc.org851becd2012-04-04 14:57:19 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org956aa7e2013-05-21 13:52:32 +000014#include "webrtc/voice_engine/include/voe_file.h"
15#include "webrtc/voice_engine/shared_data.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000016
17namespace webrtc {
18
Jelena Marusic0d266052015-05-04 14:15:32 +020019class VoEFileImpl : public VoEFile {
20 public:
21 // Playout file locally
niklase@google.com470e71d2011-07-07 08:21:25 +000022
Jelena Marusic0d266052015-05-04 14:15:32 +020023 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.com470e71d2011-07-07 08:21:25 +000030
Jelena Marusic0d266052015-05-04 14:15:32 +020031 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.com470e71d2011-07-07 08:21:25 +000037
Jelena Marusic0d266052015-05-04 14:15:32 +020038 int StopPlayingFileLocally(int channel) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000039
Jelena Marusic0d266052015-05-04 14:15:32 +020040 int IsPlayingFileLocally(int channel) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000041
Jelena Marusic0d266052015-05-04 14:15:32 +020042 // Use file as microphone input
niklase@google.com470e71d2011-07-07 08:21:25 +000043
Jelena Marusic0d266052015-05-04 14:15:32 +020044 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.com470e71d2011-07-07 08:21:25 +000050
Jelena Marusic0d266052015-05-04 14:15:32 +020051 int StartPlayingFileAsMicrophone(int channel,
52 InStream* stream,
53 bool mixWithMicrophone = false,
54 FileFormats format = kFileFormatPcm16kHzFile,
55 float volumeScaling = 1.0) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000056
Jelena Marusic0d266052015-05-04 14:15:32 +020057 int StopPlayingFileAsMicrophone(int channel) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000058
Jelena Marusic0d266052015-05-04 14:15:32 +020059 int IsPlayingFileAsMicrophone(int channel) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000060
Jelena Marusic0d266052015-05-04 14:15:32 +020061 // Record speaker signal to file
niklase@google.com470e71d2011-07-07 08:21:25 +000062
Jelena Marusic0d266052015-05-04 14:15:32 +020063 int StartRecordingPlayout(int channel,
64 const char* fileNameUTF8,
65 CodecInst* compression = NULL,
66 int maxSizeBytes = -1) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000067
Jelena Marusic0d266052015-05-04 14:15:32 +020068 int StartRecordingPlayout(int channel,
69 OutStream* stream,
70 CodecInst* compression = NULL) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000071
Jelena Marusic0d266052015-05-04 14:15:32 +020072 int StopRecordingPlayout(int channel) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000073
Jelena Marusic0d266052015-05-04 14:15:32 +020074 // Record microphone signal to file
niklase@google.com470e71d2011-07-07 08:21:25 +000075
Jelena Marusic0d266052015-05-04 14:15:32 +020076 int StartRecordingMicrophone(const char* fileNameUTF8,
77 CodecInst* compression = NULL,
78 int maxSizeBytes = -1) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000079
Jelena Marusic0d266052015-05-04 14:15:32 +020080 int StartRecordingMicrophone(OutStream* stream,
81 CodecInst* compression = NULL) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000082
Jelena Marusic0d266052015-05-04 14:15:32 +020083 int StopRecordingMicrophone() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000084
Jelena Marusic0d266052015-05-04 14:15:32 +020085 protected:
86 VoEFileImpl(voe::SharedData* shared);
87 ~VoEFileImpl() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000088
Jelena Marusic0d266052015-05-04 14:15:32 +020089 private:
90 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +000091};
92
93} // namespace webrtc
94
95#endif // WEBRTC_VOICE_ENGINE_VOE_FILE_IMPL_H