Plot very large audio files
4 views (last 30 days)
Show older comments
Hello!
I need to display very large audio files (WAV PCM, Mono, > 1 GB) in a MATLAB figure. The problem is: These audio files are too large to load the whole file into memory at once ("OUT OF MEMORY" errors).
I want to be able to see the amplitude over time, and it should be possible to zoom in and out and to do selections, just like it is in regular audio software (e.g. Adobe Audition):

So when zooming in, it should read parts of the WAV-file to update the figure. I also need to to get the absolute sample number of the current selection shown in the figure.
The closest I found was this ("Simple Audio Editor" on File Exchange):

However, it reads the whole WAV-file, and therefore it is unsuitable for large audio data.
Could you give me a hint on how to achieve what I want?
0 Comments
Answers (2)
Daniel Shub
on 30 Dec 2011
Why not just get more RAM, 1 GB isn't that big. Otherwise you are either going to have to hack the FEX contribution or write your own. There is no reason you cannot do it. You can read in bits of your sound with the wavread function
doc wavread
The problem is you are going to need to write your own functions for zooming in and out and selections. These functions are going to need to determine what portion of the file needs to be loaded, load it, and store the offset someplace. If the user zooms out too much you are going to run into memory problems. At anything but the lowest hourly rate, you are better off upgrading your hardware.
0 Comments
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!