R3 - java - audio input?

Suggestions + Info on development of R4 visuals

Moderators: rabidhamster, Rovastar

R3 - java - audio input?

Postby Lagz » Mon Jul 26, 2004 9:12 pm

Hi,

Having finished my first year and learnt some java on a stupid rubbish new course (i think frank king is changing it again next year it was so bad :)!) I am fiddling with java.

I have done some simple openGL stuff (spinning boxes etc etc).

I was wondering if you could give some vague details on how you went about processing audio in Java. Did you use a standard library or make it all yourself etc etc.

No probs if not :)!

Lagz
Lagz
 

Postby rabidhamster » Wed Jul 28, 2004 10:10 am

Hi. Yeah, I heard that course was pretty crap. Bluefish or something? I thought someone else was teaching though - Alan Blackwell? Hope you didn't hate the year too much though (I really didn't enjoy my first one).

Not sure whether you knew about this, but I got mugged 4 days before my finals, and spent all exam time so concussed that i came across as very drunk :) anyway, end result is that I don't get any grades for my 3 years work. Still get a degree tho'.

I actually used java in a slightly odd way. Basically, I had a C++ program which set up OpenGL and read audio from windows. It then set up the values in the objects in Java and called methods. That was using JNI (Java Native Interface) that allows you to reach into Java from outside and tweak/call stuff.

Wouldn't really reccomend that though. This year, a few people did audio stuff for their dissertations - and that was in Java. I think they used the 'Java Media Framework' or something similar - it seemed to be quite easy once you'd got your head around the API.

hope that helps,
- Gordon
rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby Guest » Wed Jul 28, 2004 5:17 pm

Unlucky about the mugging :( , but guess you have a strong portfolio of work what with R2 and R4 for job hunting if you havent got one already :).

I thought the first year was quite good (apart from Java, Physics and the pointless courses (software engineering 1, professional practice etc). Came out with a first so very pleased with how it went.

As you say your java use seems quite odd lol. Using javaOpenGL seems pretty straightforward, although I havent really pushed it yet so I will have to see if the garbage collection makes it pretty useless as you found. It seems to render 500 simple 'stars' on the screen and spin them round OK.

I will have a look at the Java Media FrameWork stuff when I get a chance, cheers for the tip. I dont suppose you know off the top of your head whether there is a way to control java's garbage collection or maybe clear memory manually when you have finished using it before the garbage collector goes round slowing it down??

Thanks :-)
Guest
 

Postby Lagz » Mon Aug 02, 2004 5:14 pm

Sorry bout the questions :P. Was just wondering what kind of processing you do on the sound to extract bass / treble readings etc. . .

I have been doin a bit of fiddling in java and have used fast fourier transform to create a graph showing the signal and then a processed one showing amplitude of each frequency (sampled several thousand times a minute). Obviously this eats processor lol although its pretty easy to extract information from the array of amplitudes once generated.
Lagz
 

Postby rabidhamster » Sun Aug 22, 2004 7:10 pm

Hi. I actually already had a job lined up which didn't have any grade requirements, so thats all fine.

I tried some Java OpenGL stuff a while back and it was pretty unstable - its maybe better now but then I'd decided to do my own. You can use System.gc(); to trigger the garbage collector but it never seemed to work too well when i tried. Again, maybe its better now.

I was a bit disturbed by the way you can't tell java to get rid of an object - i always though that was a big omission - especially for embedded stuff.

For the sound I do basically what you're doing - FFT on little windows of sound - 512 samples. I then just sum up the bands of the FFT (the low third for bass, etc.)

hope that helps - sorry for teh brief answer but i have about 50 posts to get through ;)
rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England


Return to R4

Who is online

Users browsing this forum: No registered users and 10 guests

cron