| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef SincResampler_h | 29 #ifndef SincResampler_h |
| 30 #define SincResampler_h | 30 #define SincResampler_h |
| 31 | 31 |
| 32 #include "platform/PlatformExport.h" | 32 #include "platform/PlatformExport.h" |
| 33 #include "platform/audio/AudioArray.h" | 33 #include "platform/audio/AudioArray.h" |
| 34 #include "platform/audio/AudioSourceProvider.h" | 34 #include "platform/audio/AudioSourceProvider.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace blink { |
| 37 | 37 |
| 38 // SincResampler is a high-quality sample-rate converter. | 38 // SincResampler is a high-quality sample-rate converter. |
| 39 | 39 |
| 40 class PLATFORM_EXPORT SincResampler { | 40 class PLATFORM_EXPORT SincResampler { |
| 41 public: | 41 public: |
| 42 // scaleFactor == sourceSampleRate / destinationSampleRate | 42 // scaleFactor == sourceSampleRate / destinationSampleRate |
| 43 // kernelSize can be adjusted for quality (higher is better) | 43 // kernelSize can be adjusted for quality (higher is better) |
| 44 // numberOfKernelOffsets is used for interpolation and is the number of sub-
sample kernel shifts. | 44 // numberOfKernelOffsets is used for interpolation and is the number of sub-
sample kernel shifts. |
| 45 SincResampler(double scaleFactor, unsigned kernelSize = 32, unsigned numberO
fKernelOffsets = 32); | 45 SincResampler(double scaleFactor, unsigned kernelSize = 32, unsigned numberO
fKernelOffsets = 32); |
| 46 | 46 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 const float* m_source; | 75 const float* m_source; |
| 76 unsigned m_sourceFramesAvailable; | 76 unsigned m_sourceFramesAvailable; |
| 77 | 77 |
| 78 // m_sourceProvider is used to provide the audio input stream to the resampl
er. | 78 // m_sourceProvider is used to provide the audio input stream to the resampl
er. |
| 79 AudioSourceProvider* m_sourceProvider; | 79 AudioSourceProvider* m_sourceProvider; |
| 80 | 80 |
| 81 // The buffer is primed once at the very beginning of processing. | 81 // The buffer is primed once at the very beginning of processing. |
| 82 bool m_isBufferPrimed; | 82 bool m_isBufferPrimed; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace WebCore | 85 } // namespace blink |
| 86 | 86 |
| 87 #endif // SincResampler_h | 87 #endif // SincResampler_h |
| OLD | NEW |