Does Java Have Built in Libraries for Audio _Synthesis_

Does java have built in libraries for audio _synthesis_?

This Sun forum post has some interesting code for generating sin tones. Also, given that the WAV file format is not overly complicated, you could create a table representing the desired waveform and then write it to a file. There are a few examples around, e.g. a raw audio converter and how to write a wav file.

Software Synth Library for Java

Have you checked out JFugue? It's an "open-source Java API for programming music without the complexities of MIDI".

Additional information: Found a couple of other resources referenced in the JFugue documentation (pdf):

  • Audio Synthesis Engine Project: open source version of Java’s MIDI synthesizer

  • Gervill: open source software synthesizer created as a proposal for the Audio Synthesis Engine Project

Java for Audio Processing is it Practical?

For an audio application you often have only very small parts of code where most of the time is spent.

In Java, you can always use the JNI (Java Native interface) and move your computational heavy code into a C-module (or assembly using SSE if you really need the power). So I'd say use Java and get your code working. If it turns out that you don't meet your performance goal use JNI.

90% of the code will most likely be glue code and application stuff anyway. But keep in mind that you loose some of the cross platform features that way. If you can live with that JNI will always leave you the door open for native code performance.

audio processing using java

As a former contributor to the JLayer MP3 Library, I'm fairly sure that it doesn't do WAV to MP3 - just MP3 playback and conversion to WAV. (I spent some time optimizing the decoder :-)

Regarding appending files (and possibly other operations), it is generally better to perform edit operations using the uncompressed format, and compress at the end.

I think the spec allows mp3 files to be concatenated, since they are a series of frames, but behaviour may vary from player to player.

So, to be safe, and maintain quality, I'd concat using WAVs and then compress the final result to MP3. Concating files is not so straightforward - you have to at least make sure they are at the same percieved volume, or you will get a noticible shift in volume from one file to the next. Such operations are definitely best performed on the uncompressed data.

Audio Processing in Java/C++

Finding music which is similar to other music is quite a complex field, and will probably require quite a bit of work if you're willing to spend quite a bit of time. If Java is your language of choice, then you could have a look at coMIRVA which will let you compare music based on timbre. From my experience, doing comparisons on that single dimensions isn't always good enough, but it is at least a start.

There's always the other path, which is to use an already existing commercial offering such as the Echo Nest and BMAT. I don't know what they cost, but it's probably quite pricey. However, these are products that have taken years to develop so I assume they must at least provide some sort of value.



Related Topics



Leave a reply



Submit