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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 void getFloatTimeDomainData(DOMFloat32Array* array) { | 71 void getFloatTimeDomainData(DOMFloat32Array* array) { |
72 m_analyser.getFloatTimeDomainData(array); | 72 m_analyser.getFloatTimeDomainData(array); |
73 } | 73 } |
74 void getByteTimeDomainData(DOMUint8Array* array) { | 74 void getByteTimeDomainData(DOMUint8Array* array) { |
75 m_analyser.getByteTimeDomainData(array); | 75 m_analyser.getByteTimeDomainData(array); |
76 } | 76 } |
77 | 77 |
78 private: | 78 private: |
79 AnalyserHandler(AudioNode&, float sampleRate); | 79 AnalyserHandler(AudioNode&, float sampleRate); |
| 80 bool propagatesSilence() const { |
| 81 // An AnalyserNode does actually propogate silence, but to get the |
| 82 // time and FFT data updated correctly, process() needs to be |
| 83 // called even if all the inputs are silent. |
| 84 return false; |
| 85 } |
80 | 86 |
81 RealtimeAnalyser m_analyser; | 87 RealtimeAnalyser m_analyser; |
82 }; | 88 }; |
83 | 89 |
84 class AnalyserNode final : public AudioBasicInspectorNode { | 90 class AnalyserNode final : public AudioBasicInspectorNode { |
85 DEFINE_WRAPPERTYPEINFO(); | 91 DEFINE_WRAPPERTYPEINFO(); |
86 | 92 |
87 public: | 93 public: |
88 static AnalyserNode* create(BaseAudioContext&, ExceptionState&); | 94 static AnalyserNode* create(BaseAudioContext&, ExceptionState&); |
89 static AnalyserNode* create(BaseAudioContext*, | 95 static AnalyserNode* create(BaseAudioContext*, |
(...skipping 17 matching lines...) Expand all Loading... |
107 private: | 113 private: |
108 AnalyserNode(BaseAudioContext&); | 114 AnalyserNode(BaseAudioContext&); |
109 AnalyserHandler& analyserHandler() const; | 115 AnalyserHandler& analyserHandler() const; |
110 | 116 |
111 void setMinMaxDecibels(double min, double max, ExceptionState&); | 117 void setMinMaxDecibels(double min, double max, ExceptionState&); |
112 }; | 118 }; |
113 | 119 |
114 } // namespace blink | 120 } // namespace blink |
115 | 121 |
116 #endif // AnalyserNode_h | 122 #endif // AnalyserNode_h |
OLD | NEW |