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 * 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 default: | 71 default: |
72 ASSERT_NOT_REACHED(); | 72 ASSERT_NOT_REACHED(); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void WaveShaperDSPKernel::processCurve(const float* source, float* destination,
size_t framesToProcess) | 76 void WaveShaperDSPKernel::processCurve(const float* source, float* destination,
size_t framesToProcess) |
77 { | 77 { |
78 ASSERT(source && destination && waveShaperProcessor()); | 78 ASSERT(source && destination && waveShaperProcessor()); |
79 | 79 |
80 Float32Array* curve = waveShaperProcessor()->curve(); | 80 DOMFloat32Array* curve = waveShaperProcessor()->curve(); |
81 if (!curve) { | 81 if (!curve) { |
82 // Act as "straight wire" pass-through if no curve is set. | 82 // Act as "straight wire" pass-through if no curve is set. |
83 memcpy(destination, source, sizeof(float) * framesToProcess); | 83 memcpy(destination, source, sizeof(float) * framesToProcess); |
84 return; | 84 return; |
85 } | 85 } |
86 | 86 |
87 float* curveData = curve->data(); | 87 float* curveData = curve->data(); |
88 int curveLength = curve->length(); | 88 int curveLength = curve->length(); |
89 | 89 |
90 ASSERT(curveData); | 90 ASSERT(curveData); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 default: | 200 default: |
201 ASSERT_NOT_REACHED(); | 201 ASSERT_NOT_REACHED(); |
202 } | 202 } |
203 | 203 |
204 return static_cast<double>(latencyFrames) / sampleRate(); | 204 return static_cast<double>(latencyFrames) / sampleRate(); |
205 } | 205 } |
206 | 206 |
207 } // namespace blink | 207 } // namespace blink |
208 | 208 |
209 #endif // ENABLE(WEB_AUDIO) | 209 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |