From a5828ad5674018e5e1f599354cccb4f5fba05847 Mon Sep 17 00:00:00 2001 From: electricmango Date: Sat, 31 Jan 2015 23:01:15 +0900 Subject: [PATCH 1/2] updated for Processing 2 (minimal edits) --- EncodeAudio.pde | 10 +++++++--- readme.md | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 readme.md diff --git a/EncodeAudio.pde b/EncodeAudio.pde index c3fac7b..03e6400 100644 --- a/EncodeAudio.pde +++ b/EncodeAudio.pde @@ -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; @@ -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++) { @@ -51,6 +54,7 @@ void setup() } exit(); + } void stop() diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..170d6d5 --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +#EncodeAudio + +*Processing sketch for translating audio files into numeric values. +* + +originally by **[David A. Mellis](https://github.com/damellis)** + +updated for Processing 2 by **[electricmango](https://github.com/electricmango)** From 36c9dcb94ca66bf2e319c84b3f95d38b755265b2 Mon Sep 17 00:00:00 2001 From: jangdan Date: Sun, 30 Apr 2017 12:58:53 +0900 Subject: [PATCH 2/2] updated readme.md according to the recent GitHub Flavored Markdown change: https://githubengineering.com/a-formal-spec-for-github-markdown/ --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 170d6d5..10d3d72 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -#EncodeAudio +# EncodeAudio *Processing sketch for translating audio files into numeric values. *