OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 public: | 21 public: |
22 virtual ~Beamformer() {} | 22 virtual ~Beamformer() {} |
23 | 23 |
24 // Process one time-domain chunk of audio. The audio is expected to be split | 24 // Process one time-domain chunk of audio. The audio is expected to be split |
25 // into frequency bands inside the ChannelBuffer. The number of frames and | 25 // into frequency bands inside the ChannelBuffer. The number of frames and |
26 // channels must correspond to the constructor parameters. The same | 26 // channels must correspond to the constructor parameters. The same |
27 // ChannelBuffer can be passed in as |input| and |output|. | 27 // ChannelBuffer can be passed in as |input| and |output|. |
28 virtual void ProcessChunk(const ChannelBuffer<T>& input, | 28 virtual void ProcessChunk(const ChannelBuffer<T>& input, |
29 ChannelBuffer<T>* output) = 0; | 29 ChannelBuffer<T>* output) = 0; |
30 | 30 |
31 // Applies the postfilter mask to one chunk of audio. The audio is expected to | |
32 // be split into frequency bands inside the ChannelBuffer. The number of | |
33 // frames must correspond to the constructor parameters and the number of | |
34 // channels is expected to be 1, since that is the output number of channels | |
35 // of ProcessChunk(). | |
36 virtual void PostFilter(ChannelBuffer<float>* data) {}; | |
peah-webrtc
2016/05/26 08:48:53
I'm not that familiar with interfaces, but why can
aluebs-webrtc
2016/05/28 03:00:00
Addressed in the other comment.
| |
37 | |
31 // Sample rate corresponds to the lower band. | 38 // Sample rate corresponds to the lower band. |
32 // Needs to be called before the the Beamformer can be used. | 39 // Needs to be called before the the Beamformer can be used. |
33 virtual void Initialize(int chunk_size_ms, int sample_rate_hz) = 0; | 40 virtual void Initialize(int chunk_size_ms, int sample_rate_hz) = 0; |
34 | 41 |
35 // Aim the beamformer at a point in space. | 42 // Aim the beamformer at a point in space. |
36 virtual void AimAt(const SphericalPointf& spherical_point) = 0; | 43 virtual void AimAt(const SphericalPointf& spherical_point) = 0; |
37 | 44 |
38 // Indicates whether a given point is inside of the beam. | 45 // Indicates whether a given point is inside of the beam. |
39 virtual bool IsInBeam(const SphericalPointf& spherical_point) { return true; } | 46 virtual bool IsInBeam(const SphericalPointf& spherical_point) { return true; } |
40 | 47 |
41 // Returns true if the current data contains the target signal. | 48 // Returns true if the current data contains the target signal. |
42 // Which signals are considered "targets" is implementation dependent. | 49 // Which signals are considered "targets" is implementation dependent. |
43 virtual bool is_target_present() = 0; | 50 virtual bool is_target_present() = 0; |
44 }; | 51 }; |
45 | 52 |
46 } // namespace webrtc | 53 } // namespace webrtc |
47 | 54 |
48 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_BEAMFORMER_H_ | 55 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_BEAMFORMER_H_ |
OLD | NEW |