[Webkit-unassigned] [Bug 189337] decodeAudioData memory garbage collected too late

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 10 16:27:54 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=189337

--- Comment #5 from ae at seven.systems ---
(In reply to Jer Noble from comment #4)
> I'm
> guessing that there's an AudioBufferSourceNode which is retaining the
> decoded AudioBuffer and that the ABSN is being kept alive long after its
> playback has completed.

As I said, I do not play back the buffer. I just use it for generating an overview. Here's the complete code (it's Tea, our in-house programming language that transcompiles to JS, but I hope it's readable enough!)

HTTP.get("sevenapp:///#{encodeURIComponent(@playingPath)}", (audioData) =>
        if not audioData?
                @clearPeaks()
                <-
        Audio.context.decodeAudioData(audioData, (buffer) =>
                if not buffer?
                        @clearPeaks()
                        <-
                samples = buffer.getChannelData(0)
                # 30 samples per second
                step = buffer.sampleRate / 30
                @peaks[@playingPath] = peaks = []
                for frame in [0...samples.length/step]
                        sum = 0
                        for index in [frame*step...(frame+1)*step] by 256 # accuracy, higher = worse, 1 = best
                                if index >= samples.length
                                        break
                                sum += Math.abs(samples[Math.floor(index)])
                        sum /= step/256
                        peaks.push(sum)
                @renderPeaks()
        )
)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180910/fda32304/attachment.html>


More information about the webkit-unassigned mailing list