0

How to export the left and right channels of a very large wave/audio file (400meg/22+mins) as an image (the best format maybe a vector image format) See wave file image below. I'm trying to superimpose the Left and right channels on top of each other to get a graphic.

I know I can do a screenshot but there's no way to get a 22+min sound file zoomed in to fit on one screen. Is there a way to export each channel zoomed in as vector art?

enter image description here

Rick T
  • 3,349
  • 10
  • 54
  • 119
  • @A.Donda I tried screenshots. – Rick T Aug 31 '14 at 16:29
  • 1
    Try reading in the audio file using `audioread`. It'll give you a 2D matrix where each column denotes the audio from each channel. After this, try plotting each channel using `plot`, then use the figure menu and save this plot as a `.eps` file. I've never dealt with such a large audio file before so you may have to fragment up the file into multiple parts, then do this separately for each part. – rayryeng Aug 31 '14 at 18:10

1 Answers1

0

In GNU Octave you can do

[Y, FS, BPS] = wavread ("out2.wav");
samples = rows (Y);
# Plot 0.2s blocks
len_seconds = 0.2;
blocksize = FS * len_seconds;
numblocks = floor (samples / blocksize);
for k=0:numblocks;
  idx_start = k * blocksize+1;
  idx_stop  = (k+1) * blocksize;
  t = linspace ((idx_start-1) / FS, idx_stop / FS, blocksize);
  plot (t, Y(idx_start:idx_stop, :))
  grid on
  xlabel ("time [s]");
  print ("-dpdf", sprintf ("waveplot%i.pdf", k));
endfor

which reads the entire wav and plots blocks which are 0.2s long. I've attached the first generated output (converted to png):

First block

If your PC has low memory (<8GB) I suggest reading the wav in chunks and process them separately, see "help wavread": [...] = wavread (FILENAME, [N1 N2]). You should also consider that the generated graphical plots needs much more space on the hardrive, I guess factor 5..20 dependent on your image format.

Andy
  • 7,931
  • 4
  • 25
  • 45