| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void Reset() override; | 41 void Reset() override; |
| 42 | 42 |
| 43 double MaxDelayTime() const { return max_delay_time_; } | 43 double MaxDelayTime() const { return max_delay_time_; } |
| 44 | 44 |
| 45 void SetDelayFrames(double number_of_frames) { | 45 void SetDelayFrames(double number_of_frames) { |
| 46 desired_delay_frames_ = number_of_frames; | 46 desired_delay_frames_ = number_of_frames; |
| 47 } | 47 } |
| 48 | 48 |
| 49 double TailTime() const override; | 49 double TailTime() const override; |
| 50 double LatencyTime() const override; | 50 double LatencyTime() const override; |
| 51 bool RequiresTailProcessing() const override; |
| 51 | 52 |
| 52 protected: | 53 protected: |
| 53 AudioDelayDSPKernel(AudioDSPKernelProcessor*, | 54 AudioDelayDSPKernel(AudioDSPKernelProcessor*, |
| 54 size_t processing_size_in_frames); | 55 size_t processing_size_in_frames); |
| 55 | 56 |
| 56 virtual bool HasSampleAccurateValues(); | 57 virtual bool HasSampleAccurateValues(); |
| 57 virtual void CalculateSampleAccurateValues(float* delay_times, | 58 virtual void CalculateSampleAccurateValues(float* delay_times, |
| 58 size_t frames_to_process); | 59 size_t frames_to_process); |
| 59 virtual double DelayTime(float sample_rate); | 60 virtual double DelayTime(float sample_rate); |
| 60 | 61 |
| 61 AudioFloatArray buffer_; | 62 AudioFloatArray buffer_; |
| 62 double max_delay_time_; | 63 double max_delay_time_; |
| 63 int write_index_; | 64 int write_index_; |
| 64 double current_delay_time_; | 65 double current_delay_time_; |
| 65 double smoothing_rate_; | 66 double smoothing_rate_; |
| 66 bool first_time_; | 67 bool first_time_; |
| 67 double desired_delay_frames_; | 68 double desired_delay_frames_; |
| 68 | 69 |
| 69 AudioFloatArray delay_times_; | 70 AudioFloatArray delay_times_; |
| 70 | 71 |
| 71 size_t BufferLengthForDelay(double delay_time, double sample_rate) const; | 72 size_t BufferLengthForDelay(double delay_time, double sample_rate) const; |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace blink | 75 } // namespace blink |
| 75 | 76 |
| 76 #endif // AudioDelayDSPKernel_h | 77 #endif // AudioDelayDSPKernel_h |
| OLD | NEW |