 |
java.net Forums
Java audio poses a number of difficult problems ranging from hardware and OS specific functionality, to getting down and dirty with low level audio formats and their representation. There are, however, a number of ways of solving these problems in the form of several audio APIs. Between JavaSound, JMF and other audio APIs, its relatively easy to take advantage of audio in your Java applications. But there can still be still problems looming under the surface. Bring your audio issues and solutions to this discussion.
Discussion Moderator:
Jonathan Simon
Showing messages 1 through 16 of 16.
-
Streaming Audio & Older version JVMs
2004-04-26 09:27:50 pixel_popper
I am developing a pure Java application for playing synchronized audio+video either from the jar file or streamed from the host. I have custom video & audio formats. My player successfully plays video, & via the JavaSound API plays synchronized audio. The issue I have is how to render audio in a scenario where the JavaSound API is not available (eg in older browser versions)? I rule out using JMF or the plug-in--I don't want the startup cost of the download. I've looked at the sun.audio classes, but can't see how they can be used in the scenario where streamed audio is converted to .au format at the client from a custom compressed format. I think there must be a workable solution to this problem having looked at the ClipStream player. Can anyone point me in the right direction? Many thanks.
-
Streaming Audio & Older version JVMs
2004-04-26 12:13:32 jonathansimon
I think youre basically hosed without the plugin. The sun.audio stuff isnt supported and youre definitely in the "use at your own risk" side of the world.
I guess there is always the other option of using something thats more likely to be installed on your clients' machines like Quicktime for Java or Flash or something.
Just a thought....
-
Sound recording and encoding difficult or impossible?
2004-04-23 12:48:15 mattbolton
From looking at the posts over the past 2 weeks, a newcomer to Java might think that recording sound and encoding it would be unduly difficult if not impossible. I am a newcomer to Java, but coming from C++, the syntax is not all that different and I was considering writing my next app with Java because of the cross-platform advantages. However, one of the key features of this app is the ability to record sound from the Line-In and then encode it,(MP3 or Ogg, or ??) So far, I have only briefly looked at the documentation on the Sound API, and it doesn't look any more complicated than say, Windows' wave API.
The part that concerns me is the ability or seeming lack of a good way to encode natively. For those that have more experience with this or know better, what are my realistic choices with encoding sound in Java? Thanks. :)
-
Sound recording and encoding difficult or impossible?
2004-04-26 11:47:37 jonathansimon
You can actually encode natively for a fact on Windows and MAC. On Windows you can save Wave files and Mac you can save Aiff. So the native stuff is taken care of. Now the compression stuff, thats a nother discussion...
As far as the API- what I dont like is that the plugin nature of JavaSound combined with the varying implementation on different platforms makes it really hard to figure out what you can, and cant do.
-
Aside from MP3 support...
2004-04-19 07:15:32 jonathansimon
OK. I think we have a consensus that Java needs 100% java, cross platform, fast, multiple audio format support.
I'd like to steer the discussion to what else we have to say about audio.
A few things worth discussin...
1. Is the JavaSound API too complicated or confusing?
2. Are you using JavaSound or JMF? Another audio API?
3. Why are you doing audio development in Java?
4. What type of audio does your application use?
A few tid-bits for thought...
-jonathan
-
Aside from MP3 support...
2004-04-22 07:46:53 invalidname
Wow, Jonathan, that's a bunch of tangents to go off on. Here's my opinion, colored as it is by being far more focused on video than audio...
1. I think the Line/Mixer metaphor is pretty tricky, especially the ideas of source and target lines (which seem backwards from your app's POV). It's also surprising that you have this complex a metaphor for an API that, as far as I can tell, is playback and transcoding only (no editing or other sample-level access... or am I wrong about this?)
2. I walked away from JMF when they dropped MP3. I had just gotten Shoutcast-style MP3-over-throttled-http streaming to work in a JMF client and open-sourced it (http://jicyshout.sourceforge.net/ ), so it was somewhat an emotional decision. But since JMF has been left to rot for four years without a meaningful update, I don't regret the decision. I'm all about QuickTime for Java right now, as you might have noticed.
3. Thick clients. I keep hearing from people who want to develop distributed media production systems, and while some of that can be browser based, working with the media requires a thick client (applet, web-start application, whatever). I've said for a while that web apps took away many potential Java markets, but media is something you can't do in a browser and could be fertile ground for Java apps.
4. Since I'm a video guy, I'm generally dealing with sound as the soundtrack to a video or interactive clip.
--Chris (invalidname)
-
modern audio playing is a joke
2004-04-15 08:15:32 lee_
I'm implementing a touch screen jukebox, currently targetted at JRE 1.4.2 on Linux, but wanting it to be cross platform.
What I want to do is play arbitrary audio and video streams, (mp3, avi, ogg, wma, mov).
However, I'm a realist and I know that for now all I really _need_ to do is play mp3s from my GUI.
Unfortunately, JMF doesn't properly support that any more, (not to mention its API seems pretty horrendous at-a-glance).
So after googling I managed to find JavaLayer from JavaZoom:
http://www.javazoom.net/javalayer/sourcesme.html
Unfortunately, it causes all sorts of pops and whistles when decoding (even in a separate thread), and on my target device, with a 533MHz CPU, it uses ~60% of the processor!
So in the end I just fork an 'mpg123' process when I need to play an mp3. It uses about 2% CPU!
I find this really really sad - it would be great if I could find something that works well but is still pure java, but that doesn't seem possible.
It also means all the really cool things I wanted to do like easy metadata displays, song durations, "seek to" features, and really great looking visualizations, are just a _very_ distant dream....
-
your 533 MHz CPU
2004-04-15 09:46:01 bboyes
HI, I'm guessing you are using the Via board?
This is not 100% related, but we are trying to get Gentoo Linux working with the Via Unichrome Video driver and XFree86 on an Epia CL10000 board and having fits. (We will be using this board with JSyn and JMSL too.) Do you have any advice to help get graphical support working on this board. It's apparently too new for any out of the box Linux graphics driver.
TIA
Bruce
-
modern audio playing is a joke
2004-04-15 08:57:43 jonathansimon
I'm with you. The whole MP3 fiasco is one of those times where I read some news and thought 'you've got to be kidding me.' (For those of you who dont know, Java used to have MP3 support, and then removed it do to licensing issues)
From my perspective- Sun's responsible for dealing with all of that legal stuff like making sure licenses are in place. And we as a developer community are left empty handed.
To make matters worse, I remember talking to the JavaSound guys and being pointed to the tritonus project. They have an MP3 plugin for JavaSound- but it only works on Linux. MORE FRUSTRATION!!! Then I got upset thinking- "um, Java. uh- cross platform."
Then I just forgot about doing MP3 is Java, much like you did.
-
modern audio playing is a joke
2004-04-15 16:42:59 bomers
Hi,
great new way of expression our deepest Java Sound concerns! Thanks Jonathan for initiating this forum.
I agree with most of the things written here, and I suffer with you...
Just some moderate defense regarding this post:
- some people who read the thing about "pointed to the tritonus project" may not know that Sun's Java Sound guy (me) was and is heavily involved with Tritonus.
- The tritonus mp3 decoder is pure Java, it is based on javazoom's mp3 decoder, which is based on tritonus :)
- the tritonus mp3 encoder is native, and as native is, it is one-platform only. Tritonus offers native mp3 encoding libs for Windows and for Linux. Once installed, however, they will work with any given Java Sound program. Cross platform.
- Tritonus is open source. Open source is: "don't complain, do it yourself"
- in any case, Tritonus' position on mp3 is: let's use ogg.
Now, I don't want to complain myself about the cited frustration, so I'd rather join you in it. Yes, it would be great if Java supported mp3, ogg, wma, real, aac, and much much more out of the box. Or if it had at least native hooks for these encodings.
Let's start it!
-
is tritonus alive?
2004-04-16 01:38:02 lee_
Is the tritonus project still alive? I took a look at the site, and the latest news item is over a year old...
Also, how does it relate to Sun's "core" JavaSound stuff - is this work likely to become part of some officially blessed framework, or is it just a hobby project (albeit a potentially very useful one)?
Maybe I'm missing some obvious links, but I can't find developer docs for anything other than fairly low-level data streaming...
-
modern audio playing is a joke
2004-04-15 12:42:55 lee_
So is there anything the developer community can do?
Petition Sun, perhaps? Appeal to a sense of reason? :)
I have ~17gig of (legal) MP3 files, and given that it's _the_ universal music format on countless operating systems and devices, it almost defies belief that a platform as great as Java is without a simple, FAST, cross platform API for playing that kind of music!
It almost strikes me as something that should have JRE-level support, given that most (all?) modern operating systems are capable of fairly efficient native decoding of audio formats... Are things like this within the scope of Sun's agenda for the Java platform?
I guess if I was the author of a Java media framework myself then this is the sort of thing I could propose a JSR for, but as an application-level developer I'm just left pulling my hair out and trying to put together .
I REALLY want to help with big acceptance of Java on the desktop and as a games development platform. Without truly modern media support, I'm not sure how I'm meant to advocate that kind of thing without getting egg on my face as soon as anyone asks about anything as simple as mp3 playback or mpeg4 video streams.
-
modern audio playing is a joke
2004-04-15 13:08:00 jonathansimon
The real issue here is licensing. Sun can't officially distribute software to decode MP3.
So in addition to the actual development effort, I think Sun has the ability and should take on the legal issue. Last I checked, none of us have legal teams working for us. So I think where Sun can help out with the Java platform in general is to solve some of these legal problems and just get us coding already!
-
modern audio playing is a joke
2004-04-16 03:30:09 invalidname
I don't know if I agree that Sun "can't officially distribute software to decode MP3". Microsoft and Apple have no problem distributing MP3 decoders with their respective operating systems. Yes, there's a cost - the MP3 licensing page ( http://www.mp3licensing.com/royalty/index.html ) shows it as $60K one-time paid-up for MP3 decoding - but that doesn't seem an intolerable expense for the sake of building a platform. Yanking MP3 from JMF probably caused more than $60K in damage to Java's credibility by implicitly telling developers that Sun's not serious about media.
Interesting that this discussion got started on the day that JavaZoom released a new version of their MP3 plug-in for JavaSound ( http://www.javazoom.net/mp3spi/mp3spi.html ). Interesting question: how are they able to distribute an all-Java MP3 player without passing on royalty costs to end-users?
--Chris (invalidname)
-
Sound and Applets
2004-04-15 07:48:06 smbell
I haven't done any programming where the sound timing was crucial (although as a former musician myself I understand) what I've found most aggrivating in the limited use I've had with Java Sound is the simplest most straightforward way to simply play a sound, the AudioClip Interface, is tied to the the Applet class.
While this is not powerful enough for many things, If I just want to add a couple of happy sounds to a desktop app I have to go throught much the same process as when I want multiple sounds and background music for a game.
-
Hello and Welcome
2004-04-15 06:36:59 jonathansimon
Hello,
I wanted to welcome you all to the java.net Audio Forum. I will be the moderator for the length of the forum (about two weeks, I think). I actually came to programming by way of music and eventually music software, so Ive always had a soft spot for audio.
I'd like to kick off the discussion by talking about what Java audio APIs you have used and how you felt about them (pros, cons, support, performance, issues, etc). Ill kick it off with a brief description of what Ive used.
I wrote my first Java music software using JavaSound. I found the API pretty confusing, but eventually got the hang of it. The open architecture for adding plugins and different functionality implemented on different platforms made it really hard to learn. Once I learned the basics though, I wrote a test app pretty quickly. Then came the forever show stopping problem for me and JavaSound no accurate timing. I was writing an advanced metronome, so this was a killer!
I went from there to a third party audio API called JSyn. I had great success with this. The API was easy to use and well documented. Also, the guy who wrote it, Phil Burk, is a really easy going guy and helped me out a lot. The problems here were (a) written and supported by one guy (b) not part of the JRE, so deployment is an issue (c) it uses native code and JNI to perform accurate time scheduling.
So thats basically where I stand now. I use JavaSound when Im doing basic audio (non-MIDI, non-time sensitive) development. And when I need something more accurate time scheduling wise, I use JSyn.
What do you use, and how do you like it?
-jonathan
|
Showing messages 1 through 16 of 16.
|
|