lmbvarela / cat200-9-2010

Automatically exported from code.google.com/p/cat200-9-2010
0 stars 0 forks source link

Recording module- audio cutter #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm unable to do the audio cutter part and faced problems in finding the sample 
source code for this cutter part.Got anyone who able to find out the sample 
code for this audio cutter?? 

Original issue reported on code.google.com by sywong10...@gmail.com on 4 Oct 2010 at 4:24

GoogleCodeExporter commented 8 years ago
Try to copy the byte audioData [] into a new byte [] using 
System.arrayCopy(..). Here's a snippet of code I found in 
http://www.java-tips.org/other-api-tips/jogl/line-antialiasing-timing-ortho-view
-and-simple-sounds-nehe-tutorial-jogl.html

private static byte[] trim(byte[] data, int amount) {
        if (data == null) {
            return new byte[amount];
        } else if (data.length == amount) {
            return data;
        } else {
            byte[] newArray = new byte[amount];
            System.arraycopy(data, 0, newArray, 0, amount);
            return newArray;
        }
    }

Original comment by seahlin...@gmail.com on 9 Oct 2010 at 3:50

GoogleCodeExporter commented 8 years ago
ok, i will go through the java code in the URL link.Thanks anyway !!

Original comment by sywong10...@gmail.com on 9 Oct 2010 at 6:01