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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 String::number(numberOfChannels)); | 123 String::number(numberOfChannels)); |
124 return; | 124 return; |
125 } | 125 } |
126 | 126 |
127 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not | 127 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not |
128 // a memcpy(). This memory is simply used in the Reverb constructor and no | 128 // a memcpy(). This memory is simply used in the Reverb constructor and no |
129 // reference to it is kept for later use in that class. | 129 // reference to it is kept for later use in that class. |
130 RefPtr<AudioBus> bufferBus = | 130 RefPtr<AudioBus> bufferBus = |
131 AudioBus::create(numberOfChannels, bufferLength, false); | 131 AudioBus::create(numberOfChannels, bufferLength, false); |
132 for (unsigned i = 0; i < numberOfChannels; ++i) | 132 for (unsigned i = 0; i < numberOfChannels; ++i) |
133 bufferBus->setChannelMemory(i, buffer->getChannelData(i)->data(), | 133 bufferBus->setChannelMemory(i, buffer->getChannelData(i).view()->data(), |
134 bufferLength); | 134 bufferLength); |
135 | 135 |
136 bufferBus->setSampleRate(buffer->sampleRate()); | 136 bufferBus->setSampleRate(buffer->sampleRate()); |
137 | 137 |
138 // Create the reverb with the given impulse response. | 138 // Create the reverb with the given impulse response. |
139 std::unique_ptr<Reverb> reverb = WTF::wrapUnique(new Reverb( | 139 std::unique_ptr<Reverb> reverb = WTF::wrapUnique(new Reverb( |
140 bufferBus.get(), AudioUtilities::kRenderQuantumFrames, MaxFFTSize, | 140 bufferBus.get(), AudioUtilities::kRenderQuantumFrames, MaxFFTSize, |
141 context() && context()->hasRealtimeConstraint(), m_normalize)); | 141 context() && context()->hasRealtimeConstraint(), m_normalize)); |
142 | 142 |
143 { | 143 { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 bool ConvolverNode::normalize() const { | 304 bool ConvolverNode::normalize() const { |
305 return convolverHandler().normalize(); | 305 return convolverHandler().normalize(); |
306 } | 306 } |
307 | 307 |
308 void ConvolverNode::setNormalize(bool normalize) { | 308 void ConvolverNode::setNormalize(bool normalize) { |
309 convolverHandler().setNormalize(normalize); | 309 convolverHandler().setNormalize(normalize); |
310 } | 310 } |
311 | 311 |
312 } // namespace blink | 312 } // namespace blink |
OLD | NEW |