News for hackers. Stuff that matters.
Re:Lessons learnt building a real-time audio application in ... by CyberDildonics on Monday September 09, 2024 @09:03PM (#41496120)
When you see someone using python for something as real time and latency sensitive as audio don't you expect more wacky red flags on top of the fact that python is going to 50x to 100x slower than a native program?

Crazy numbers on top of a dictionary of arrays? It's all there.

Re:Lessons learnt building a real-time audio application in ... by camtarn on Tuesday September 10, 2024 @04:04AM (#41498366)
Not necessarily. "I convinced this language/system to do something it really wasn't designed to do by optimising everything" is a well established genre of article :)
Re:Lessons learnt building a real-time audio application in ... by spmvg on Tuesday September 10, 2024 @10:39AM (#41501253)
:)
Re:Lessons learnt building a real-time audio application in ... by spmvg on Tuesday September 10, 2024 @10:38AM (#41501247)
Half the fun of this project has been doing it in Python and performance hasn't been an issue so far, which says something about how fast Python is already. And indeed native would be ~50x-100x faster.

I must defend the design choice for the dictionary of arrays though, this has been a very conscious choice:

  - The "dictionary-of-arrays" approach allows lookups in constant time O(1), irrespectively of how much data has already been stored (compared to one big array)
  - The dictionary structure allows me to throw away data in the middle easily (without having to handle growing arrays), because the "dictionary-of-arrays" has already been chunked. The audio looper will use only some parts of the recorded audio, leaving big parts in between unused.
Re:Lessons learnt building a real-time audio application in ... by pjmlp on Tuesday September 10, 2024 @12:45PM (#41502817)
It is really a hammer for a screw.