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