| 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 19 matching lines...) Expand all Loading... |
| 30 #include "platform/audio/AudioUtilities.h" | 30 #include "platform/audio/AudioUtilities.h" |
| 31 #include "platform/audio/VectorMath.h" | 31 #include "platform/audio/VectorMath.h" |
| 32 #include "wtf/MainThread.h" | 32 #include "wtf/MainThread.h" |
| 33 #include "wtf/MathExtras.h" | 33 #include "wtf/MathExtras.h" |
| 34 #include <algorithm> | 34 #include <algorithm> |
| 35 #include <complex> | 35 #include <complex> |
| 36 #include <limits.h> | 36 #include <limits.h> |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 const double RealtimeAnalyser::DefaultSmoothingTimeConstant = 0.8; | 40 const double RealtimeAnalyser::DefaultSmoothingTimeConstant = 0.8; |
| 41 const double RealtimeAnalyser::DefaultMinDecibels = -100; | 41 const double RealtimeAnalyser::DefaultMinDecibels = -100; |
| 42 const double RealtimeAnalyser::DefaultMaxDecibels = -30; | 42 const double RealtimeAnalyser::DefaultMaxDecibels = -30; |
| 43 | 43 |
| 44 const unsigned RealtimeAnalyser::DefaultFFTSize = 2048; | 44 const unsigned RealtimeAnalyser::DefaultFFTSize = 2048; |
| 45 // All FFT implementations are expected to handle power-of-two sizes MinFFTSize
<= size <= MaxFFTSize. | 45 // All FFT implementations are expected to handle power-of-two sizes MinFFTSize
<= size <= MaxFFTSize. |
| 46 const unsigned RealtimeAnalyser::MinFFTSize = 32; | 46 const unsigned RealtimeAnalyser::MinFFTSize = 32; |
| 47 const unsigned RealtimeAnalyser::MaxFFTSize = 32768; | 47 const unsigned RealtimeAnalyser::MaxFFTSize = 32768; |
| 48 const unsigned RealtimeAnalyser::InputBufferSize = RealtimeAnalyser::MaxFFTSize
* 2; | 48 const unsigned RealtimeAnalyser::InputBufferSize = RealtimeAnalyser::MaxFFTSize
* 2; |
| 49 | 49 |
| 50 RealtimeAnalyser::RealtimeAnalyser() | 50 RealtimeAnalyser::RealtimeAnalyser() |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 scaledValue = UCHAR_MAX; | 312 scaledValue = UCHAR_MAX; |
| 313 | 313 |
| 314 destination[i] = static_cast<unsigned char>(scaledValue); | 314 destination[i] = static_cast<unsigned char>(scaledValue); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace blink | 319 } // namespace blink |
| 320 | 320 |
| 321 #endif // ENABLE(WEB_AUDIO) | 321 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |