| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| 13 | 13 |
| 14 // MSVC++ requires this to be set before any other includes to get M_PI. |
| 15 #define _USE_MATH_DEFINES |
| 16 |
| 17 #include <math.h> |
| 14 #include <stddef.h> // size_t | 18 #include <stddef.h> // size_t |
| 15 #include <stdio.h> // FILE | 19 #include <stdio.h> // FILE |
| 16 #include <vector> | 20 #include <vector> |
| 17 | 21 |
| 18 #include "webrtc/base/arraysize.h" | 22 #include "webrtc/base/arraysize.h" |
| 19 #include "webrtc/base/platform_file.h" | 23 #include "webrtc/base/platform_file.h" |
| 20 #include "webrtc/common.h" | 24 #include "webrtc/common.h" |
| 21 #include "webrtc/modules/audio_processing/beamformer/array_util.h" | 25 #include "webrtc/modules/audio_processing/beamformer/array_util.h" |
| 22 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
| 23 | 27 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 ExperimentalNs() : enabled(false) {} | 106 ExperimentalNs() : enabled(false) {} |
| 103 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} | 107 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} |
| 104 bool enabled; | 108 bool enabled; |
| 105 }; | 109 }; |
| 106 | 110 |
| 107 // Use to enable beamforming. Must be provided through the constructor. It will | 111 // Use to enable beamforming. Must be provided through the constructor. It will |
| 108 // have no impact if used with AudioProcessing::SetExtraOptions(). | 112 // have no impact if used with AudioProcessing::SetExtraOptions(). |
| 109 struct Beamforming { | 113 struct Beamforming { |
| 110 Beamforming() | 114 Beamforming() |
| 111 : enabled(false), | 115 : enabled(false), |
| 112 array_geometry() {} | 116 array_geometry(), |
| 117 target_direction( |
| 118 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) {} |
| 113 Beamforming(bool enabled, const std::vector<Point>& array_geometry) | 119 Beamforming(bool enabled, const std::vector<Point>& array_geometry) |
| 120 : Beamforming(enabled, |
| 121 array_geometry, |
| 122 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) { |
| 123 } |
| 124 Beamforming(bool enabled, |
| 125 const std::vector<Point>& array_geometry, |
| 126 SphericalPointf target_direction) |
| 114 : enabled(enabled), | 127 : enabled(enabled), |
| 115 array_geometry(array_geometry) {} | 128 array_geometry(array_geometry), |
| 129 target_direction(target_direction) {} |
| 116 const bool enabled; | 130 const bool enabled; |
| 117 const std::vector<Point> array_geometry; | 131 const std::vector<Point> array_geometry; |
| 132 const SphericalPointf target_direction; |
| 118 }; | 133 }; |
| 119 | 134 |
| 120 // Use to enable intelligibility enhancer in audio processing. Must be provided | 135 // Use to enable intelligibility enhancer in audio processing. Must be provided |
| 121 // though the constructor. It will have no impact if used with | 136 // though the constructor. It will have no impact if used with |
| 122 // AudioProcessing::SetExtraOptions(). | 137 // AudioProcessing::SetExtraOptions(). |
| 123 // | 138 // |
| 124 // Note: If enabled and the reverse stream has more than one output channel, | 139 // Note: If enabled and the reverse stream has more than one output channel, |
| 125 // the reverse stream will become an upmixed mono signal. | 140 // the reverse stream will become an upmixed mono signal. |
| 126 struct Intelligibility { | 141 struct Intelligibility { |
| 127 Intelligibility() : enabled(false) {} | 142 Intelligibility() : enabled(false) {} |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 // This does not impact the size of frames passed to |ProcessStream()|. | 944 // This does not impact the size of frames passed to |ProcessStream()|. |
| 930 virtual int set_frame_size_ms(int size) = 0; | 945 virtual int set_frame_size_ms(int size) = 0; |
| 931 virtual int frame_size_ms() const = 0; | 946 virtual int frame_size_ms() const = 0; |
| 932 | 947 |
| 933 protected: | 948 protected: |
| 934 virtual ~VoiceDetection() {} | 949 virtual ~VoiceDetection() {} |
| 935 }; | 950 }; |
| 936 } // namespace webrtc | 951 } // namespace webrtc |
| 937 | 952 |
| 938 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 953 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| OLD | NEW |