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 10 matching lines...) Expand all Loading... |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef AudioResamplerKernel_h | 25 #ifndef AudioResamplerKernel_h |
26 #define AudioResamplerKernel_h | 26 #define AudioResamplerKernel_h |
27 | 27 |
28 #include "platform/PlatformExport.h" | 28 #include "platform/PlatformExport.h" |
29 #include "platform/audio/AudioArray.h" | 29 #include "platform/audio/AudioArray.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace blink { |
32 | 32 |
33 class AudioResampler; | 33 class AudioResampler; |
34 | 34 |
35 // AudioResamplerKernel does resampling on a single mono channel. | 35 // AudioResamplerKernel does resampling on a single mono channel. |
36 // It uses a simple linear interpolation for good performance. | 36 // It uses a simple linear interpolation for good performance. |
37 | 37 |
38 class PLATFORM_EXPORT AudioResamplerKernel { | 38 class PLATFORM_EXPORT AudioResamplerKernel { |
39 public: | 39 public: |
40 AudioResamplerKernel(AudioResampler*); | 40 AudioResamplerKernel(AudioResampler*); |
41 | 41 |
(...skipping 23 matching lines...) Expand all Loading... |
65 double m_virtualReadIndex; | 65 double m_virtualReadIndex; |
66 | 66 |
67 // We need to have continuity from one call of process() to the next. | 67 // We need to have continuity from one call of process() to the next. |
68 // m_lastValues stores the last two sample values from the last call to proc
ess(). | 68 // m_lastValues stores the last two sample values from the last call to proc
ess(). |
69 // m_fillIndex represents how many buffered samples we have which can be as
many as 2. | 69 // m_fillIndex represents how many buffered samples we have which can be as
many as 2. |
70 // For the first call to process() (or after reset()) there will be no buffe
red samples. | 70 // For the first call to process() (or after reset()) there will be no buffe
red samples. |
71 float m_lastValues[2]; | 71 float m_lastValues[2]; |
72 unsigned m_fillIndex; | 72 unsigned m_fillIndex; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace WebCore | 75 } // namespace blink |
76 | 76 |
77 #endif // AudioResamplerKernel_h | 77 #endif // AudioResamplerKernel_h |
OLD | NEW |