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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 if (!buffer) | 118 if (!buffer) |
119 return; | 119 return; |
120 | 120 |
121 if (buffer->sampleRate() != context()->sampleRate()) { | 121 if (buffer->sampleRate() != context()->sampleRate()) { |
122 exceptionState.throwDOMException( | 122 exceptionState.throwDOMException( |
123 NotSupportedError, | 123 NotSupportedError, |
124 "The buffer sample rate of " + String::number(buffer->sampleRate()) | 124 "The buffer sample rate of " + String::number(buffer->sampleRate()) |
125 + " does not match the context rate of " + String::number(context()-
>sampleRate()) | 125 + " does not match the context rate of " + String::number(context()-
>sampleRate()) |
126 + " Hz."); | 126 + " Hz."); |
| 127 return; |
127 } | 128 } |
128 | 129 |
129 unsigned numberOfChannels = buffer->numberOfChannels(); | 130 unsigned numberOfChannels = buffer->numberOfChannels(); |
130 size_t bufferLength = buffer->length(); | 131 size_t bufferLength = buffer->length(); |
131 | 132 |
132 // The current implementation supports up to four channel impulse responses,
which are interpreted as true-stereo (see Reverb class). | 133 // The current implementation supports up to four channel impulse responses,
which are interpreted as true-stereo (see Reverb class). |
133 bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferL
ength; | 134 bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferL
ength; |
134 ASSERT(isBufferGood); | 135 ASSERT(isBufferGood); |
135 if (!isBufferGood) | 136 if (!isBufferGood) |
136 return; | 137 return; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 222 } |
222 | 223 |
223 void ConvolverNode::setNormalize(bool normalize) | 224 void ConvolverNode::setNormalize(bool normalize) |
224 { | 225 { |
225 convolverHandler().setNormalize(normalize); | 226 convolverHandler().setNormalize(normalize); |
226 } | 227 } |
227 | 228 |
228 } // namespace blink | 229 } // namespace blink |
229 | 230 |
230 #endif // ENABLE(WEB_AUDIO) | 231 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |