| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #if ENABLE(WEB_AUDIO) | 27 #if ENABLE(WEB_AUDIO) |
| 28 | 28 |
| 29 #include "platform/audio/AudioResamplerKernel.h" | 29 #include "platform/audio/AudioResamplerKernel.h" |
| 30 | 30 |
| 31 #include <algorithm> | 31 #include <algorithm> |
| 32 #include "platform/audio/AudioResampler.h" | 32 #include "platform/audio/AudioResampler.h" |
| 33 | 33 |
| 34 using namespace std; | 34 using namespace std; |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace blink { |
| 37 | 37 |
| 38 const size_t AudioResamplerKernel::MaxFramesToProcess = 128; | 38 const size_t AudioResamplerKernel::MaxFramesToProcess = 128; |
| 39 | 39 |
| 40 AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler) | 40 AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler) |
| 41 : m_resampler(resampler) | 41 : m_resampler(resampler) |
| 42 // The buffer size must be large enough to hold up to two extra sample frame
s for the linear interpolation. | 42 // The buffer size must be large enough to hold up to two extra sample frame
s for the linear interpolation. |
| 43 , m_sourceBuffer(2 + static_cast<int>(MaxFramesToProcess * AudioResampler::M
axRate)) | 43 , m_sourceBuffer(2 + static_cast<int>(MaxFramesToProcess * AudioResampler::M
axRate)) |
| 44 , m_virtualReadIndex(0.0) | 44 , m_virtualReadIndex(0.0) |
| 45 , m_fillIndex(0) | 45 , m_fillIndex(0) |
| 46 { | 46 { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 m_fillIndex = 0; | 131 m_fillIndex = 0; |
| 132 m_lastValues[0] = 0.0f; | 132 m_lastValues[0] = 0.0f; |
| 133 m_lastValues[1] = 0.0f; | 133 m_lastValues[1] = 0.0f; |
| 134 } | 134 } |
| 135 | 135 |
| 136 double AudioResamplerKernel::rate() const | 136 double AudioResamplerKernel::rate() const |
| 137 { | 137 { |
| 138 return m_resampler->rate(); | 138 return m_resampler->rate(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace WebCore | 141 } // namespace blink |
| 142 | 142 |
| 143 #endif // ENABLE(WEB_AUDIO) | 143 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |