echo66 / PhaseVocoderJS

GNU Affero General Public License v3.0
54 stars 7 forks source link

Manage memory "manually" #15

Closed echo66 closed 9 years ago

echo66 commented 9 years ago

Right now, the phase vocoder implementation is creating A LOT of arrays (Array & Float64Array). This has a negative impact due to the fact that I can't control the garbage collector. And, in fact, this may be the real cause for poor performance when dealing with more than two tracks. So, I need to alloc enough memory (i.e. create a memory heap) in the phase vocoder constructor and each vector/array access will be coded as HEAP[start + position].

echo66 commented 9 years ago

Instead of creating a heap, I used several objects to hold the arrays that had the same dimensions in every iteration. Unfortunately, I'm still getting dropouts when I play the third audio piece.