Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions EncodeAudio.pde
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ void setup()
{
size(512, 200);

String file = selectInput("Select audio file to encode.");

selectInput("Select audio file to encode.", "callback");
}
void callback(File sfile){
String file = sfile.getAbsolutePath();

if (file == null) {
exit();
return;
Expand All @@ -25,7 +28,7 @@ void setup()
minim = new Minim(this);
sample = minim.loadSample(file);

float[] samples = sample.getChannel(BufferedAudio.LEFT);
float[] samples = sample.getChannel(1); //BufferedAudio.LEFT
float maxval = 0;

for (int i = 0; i < samples.length; i++) {
Expand All @@ -51,6 +54,7 @@ void setup()
}

exit();

}

void stop()
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# EncodeAudio

*Processing sketch for translating audio files into numeric values.
<http://hlt.media.mit.edu/?p=1963>*

originally by **[David A. Mellis](https://github.com/damellis)**

updated for Processing 2 by **[electricmango](https://github.com/electricmango)**