Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

how to draw a waveform for an entire sound file ?

$
0
0

Hello, I would like to draw the waveform of an entire sound file.
I have seen the example from the documentation, but this is an osciloscope, which works with a buffer, whereas I would like to draw for the entire file, as in soundcloud for example.

import ddf.minim.*;
Minim minim;
AudioPlayer sound;

void setup() {
  size(300, 200);
  minim = new Minim(this);
  sound = minim.loadFile("mySound.wav");

  println(sound.length());

  for (int i=0; i < sound.length()-1024; i+=16) {
   println( sound.mix.get(i));
  }
  exit();
}

this did not work because, because get(i) "Gets the i sample in the buffer", wich size is 1024...
how to have all the sample value inside the file ?

thx.


Viewing all articles
Browse latest Browse all 2896

Trending Articles