Bug 213393

Summary: Added getFloatTimeDomainData method to AnalyserNode
Product: WebKit Reporter: Clark Wang <clark_wang>
Component: Web AudioAssignee: Clark Wang <clark_wang>
Status: RESOLVED FIXED    
Severity: Minor CC: cdumez, eric.carlson, esprehn+autocc, ews-watchlist, glenn, jer.noble, kondapallykalyan, parametrize, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 212611    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Clark Wang
Reported 2020-06-19 11:09:53 PDT
Added getFloatTimeDomainData method to AnalyserNode
Attachments
Patch (6.53 KB, patch)
2020-06-19 11:13 PDT, Clark Wang
no flags
Patch (13.09 KB, patch)
2020-06-19 15:27 PDT, Clark Wang
no flags
Patch (11.78 KB, patch)
2020-06-22 08:12 PDT, Clark Wang
no flags
Clark Wang
Comment 1 2020-06-19 11:13:18 PDT
Chris Dumez
Comment 2 2020-06-19 11:36:50 PDT
Comment on attachment 402296 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402296&action=review > Source/WebCore/Modules/webaudio/AnalyserNode.idl:45 > + void getFloatTimeDomainData(Float32Array? array); // FIXME: The parameter should not be nullable. Since this is new code, why a FIXME comment? Why not make the parameter non-nullable? Also, everything you add should be behind the Modern Web Audio flag so: [EnabledBySetting=ModernUnprefixedWebAudio] void getFloatTimeDomainData(Float32Array array); > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:265 > +void RealtimeAnalyser::getFloatTimeDomainData(Float32Array* destinationArray) If this implementation is based on the Blink one, please state so in the ChangeLog file. > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:273 > + size_t len = std::min(fftSize, destinationArray->length()); No abbreviations in WebKit: len -> length > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:285 > + for (unsigned i = 0; i < len; ++i) { len is a size_t so please use same type for i. > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:287 > + float value = inputBuffer[(i + writeIndex - fftSize + InputBufferSize) % InputBufferSize]; This local variable is not needed.
Clark Wang
Comment 3 2020-06-19 15:27:04 PDT
Chris Dumez
Comment 4 2020-06-19 17:52:19 PDT
Comment on attachment 402335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402335&action=review > Source/WebCore/Modules/webaudio/AnalyserNode.h:58 > + void getFloatTimeDomainData(const RefPtr<JSC::Float32Array>& array) { m_analyser.getFloatTimeDomainData(array.get()); } const Ref<JSC::Float32Array>& Same for others. > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:-107 > - return; Please configure your IDE to stop doing these things. We try to avoid unrelated changes in patches as much as possible. > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:-207 > - if (!destinationArray) Since destinationArray cannot take null anymore, the parameter should be of type: Float32Array& destinationArray This means you'll need to update AnalyzerNode::getFloatFrequencyData() to take in a Ref<> instead of a RefPtr<>. > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:-232 > - if (!destinationArray) ditto > Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:-269 > - if (!destinationArray) ditto.
Clark Wang
Comment 5 2020-06-22 08:12:36 PDT
EWS
Comment 6 2020-06-22 12:26:49 PDT
Committed r263359: <https://trac.webkit.org/changeset/263359> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402474 [details].
Radar WebKit Bug Importer
Comment 7 2020-06-22 12:27:17 PDT
Chris Dumez
Comment 8 2021-01-05 08:30:38 PST
*** Bug 220023 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.