Originally Posted by
c99tutorial
By the way, if you look at programs that handle uncompressed audio like Audacity you will see that they don't typically load the entire sample into memory at one time. They load chunks of it and keep almost all of it on disk. As your audio data becomes larger, this strategy will be more and more useful. You could theoretically load everything into dynamic memory and just let the operating system handle swapping it to disk for you when it gets too large, but this strategy usually leads to programs which are not responsive to user input.