| 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 20 matching lines...) Expand all Loading... |
| 31 #include <algorithm> | 31 #include <algorithm> |
| 32 #include "platform/audio/AudioBus.h" | 32 #include "platform/audio/AudioBus.h" |
| 33 #include "platform/audio/AudioUtilities.h" | 33 #include "platform/audio/AudioUtilities.h" |
| 34 #include "wtf/MathExtras.h" | 34 #include "wtf/MathExtras.h" |
| 35 | 35 |
| 36 // Use a 50ms smoothing / de-zippering time-constant. | 36 // Use a 50ms smoothing / de-zippering time-constant. |
| 37 const float SmoothingTimeConstant = 0.050f; | 37 const float SmoothingTimeConstant = 0.050f; |
| 38 | 38 |
| 39 using namespace std; | 39 using namespace std; |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace blink { |
| 42 | 42 |
| 43 EqualPowerPanner::EqualPowerPanner(float sampleRate) | 43 EqualPowerPanner::EqualPowerPanner(float sampleRate) |
| 44 : Panner(PanningModelEqualPower) | 44 : Panner(PanningModelEqualPower) |
| 45 , m_isFirstRender(true) | 45 , m_isFirstRender(true) |
| 46 , m_gainL(0.0) | 46 , m_gainL(0.0) |
| 47 , m_gainR(0.0) | 47 , m_gainR(0.0) |
| 48 { | 48 { |
| 49 m_smoothingConstant = AudioUtilities::discreteTimeConstantForSampleRate(Smoo
thingTimeConstant, sampleRate); | 49 m_smoothingConstant = AudioUtilities::discreteTimeConstantForSampleRate(Smoo
thingTimeConstant, sampleRate); |
| 50 } | 50 } |
| 51 | 51 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 *destinationL++ = static_cast<float>(inputL * gainL); | 147 *destinationL++ = static_cast<float>(inputL * gainL); |
| 148 *destinationR++ = static_cast<float>(inputR + inputL * gainR); | 148 *destinationR++ = static_cast<float>(inputR + inputL * gainR); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 m_gainL = gainL; | 153 m_gainL = gainL; |
| 154 m_gainR = gainR; | 154 m_gainR = gainR; |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace WebCore | 157 } // namespace blink |
| 158 | 158 |
| 159 #endif // ENABLE(WEB_AUDIO) | 159 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |