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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 double loopEndFrame = m_loopEnd * buffer()->sampleRate(); | 229 double loopEndFrame = m_loopEnd * buffer()->sampleRate(); |
230 | 230 |
231 virtualEndFrame = std::min(loopEndFrame, virtualEndFrame); | 231 virtualEndFrame = std::min(loopEndFrame, virtualEndFrame); |
232 virtualDeltaFrames = virtualEndFrame - loopStartFrame; | 232 virtualDeltaFrames = virtualEndFrame - loopStartFrame; |
233 } | 233 } |
234 | 234 |
235 | 235 |
236 double pitchRate = totalPitchRate(); | 236 double pitchRate = totalPitchRate(); |
237 | 237 |
238 // Sanity check that our playback rate isn't larger than the loop size. | 238 // Sanity check that our playback rate isn't larger than the loop size. |
239 if (pitchRate >= virtualDeltaFrames) | 239 if (pitchRate > virtualDeltaFrames) |
240 return false; | 240 return false; |
241 | 241 |
242 // Get local copy. | 242 // Get local copy. |
243 double virtualReadIndex = m_virtualReadIndex; | 243 double virtualReadIndex = m_virtualReadIndex; |
244 | 244 |
245 // Render loop - reading from the source buffer to the destination using lin
ear interpolation. | 245 // Render loop - reading from the source buffer to the destination using lin
ear interpolation. |
246 int framesToProcess = numberOfFrames; | 246 int framesToProcess = numberOfFrames; |
247 | 247 |
248 const float** sourceChannels = m_sourceChannels.get(); | 248 const float** sourceChannels = m_sourceChannels.get(); |
249 float** destinationChannels = m_destinationChannels.get(); | 249 float** destinationChannels = m_destinationChannels.get(); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 { | 503 { |
504 visitor->trace(m_buffer); | 504 visitor->trace(m_buffer); |
505 visitor->trace(m_playbackRate); | 505 visitor->trace(m_playbackRate); |
506 visitor->trace(m_pannerNode); | 506 visitor->trace(m_pannerNode); |
507 AudioScheduledSourceNode::trace(visitor); | 507 AudioScheduledSourceNode::trace(visitor); |
508 } | 508 } |
509 | 509 |
510 } // namespace blink | 510 } // namespace blink |
511 | 511 |
512 #endif // ENABLE(WEB_AUDIO) | 512 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |