audio streaming with javafx

377 views
Skip to first unread message

Riccardo Tacconi

unread,
Sep 23, 2008, 9:12:02 AM9/23/08
to jav...@googlegroups.com
Hi,

does anybody knows if it is possible to stream audio with Javafx? What is the best solution for streaming audio with Java in a web application?

Thanks,

--
Riccardo Tacconi
VIRUTELOGIC LIMITED

Linux user: #400461

Phil Haigh

unread,
Sep 23, 2008, 9:29:12 AM9/23/08
to jav...@googlegroups.com
Riccardo,

Streaming via HTTP is in the feature list for 1.0 of JavaFX but Is not
available in the current preview.

There are a number of commercial alternatives out there. Just search
for 'java audio streaming'

Phil.

Riccardo Tacconi

unread,
Sep 23, 2008, 9:46:43 AM9/23/08
to jav...@googlegroups.com
On Tue, Sep 23, 2008 at 2:29 PM, Phil Haigh <ph...@haigh-family.com> wrote:

Riccardo,

Streaming via HTTP is in the feature list for 1.0 of JavaFX but Is not
available in the current preview.

Actually I need to capture the audio from the microphone> I am interested in audio conferencing. I have tested JMF in the past and I was thinking about if there is an alternative for Javafx.


There are a number of commercial alternatives out there. Just search
for 'java audio streaming'

This seach is not so useful.
 

Phil.

On 23 Sep 2008, at 14:12, "Riccardo Tacconi" <rtac...@gmail.com> wrote:

> Hi,
>
> does anybody knows if it is possible to stream audio with Javafx?
> What is the best solution for streaming audio with Java in a web
> application?
>
> Thanks,
>
> --
> Riccardo Tacconi
> VIRUTELOGIC LIMITED
>
> Linux user: #400461
>
> >


Phil Haigh

unread,
Sep 23, 2008, 9:50:17 AM9/23/08
to jav...@googlegroups.com
Riccardo,

Ok fair enough, but if you want audio recording as well as streaming then you need to say so, sorry I can't be more helpful. 

Phil. 

Riccardo Tacconi

unread,
Sep 23, 2008, 11:57:47 AM9/23/08
to jav...@googlegroups.com
Phil,

you're right, I apologise.

Peter Pilgrim

unread,
Sep 23, 2008, 12:25:29 PM9/23/08
to jav...@googlegroups.com
2008/9/23 Riccardo Tacconi <rtac...@gmail.com>:

>
>
> On Tue, Sep 23, 2008 at 2:29 PM, Phil Haigh <ph...@haigh-family.com> wrote:
>>
>> Riccardo,
>>
>> Streaming via HTTP is in the feature list for 1.0 of JavaFX but Is not
>> available in the current preview.
>
> Actually I need to capture the audio from the microphone> I am interested in
> audio conferencing. I have tested JMF in the past and I was thinking about
> if there is an alternative for Javafx.
>>
>>
>> There are a number of commercial alternatives out there. Just search
>> for 'java audio streaming'
>
> This seach is not so useful.

Hi

Actually on this front Flash and Flex still wins, because the Java
Media Component API will not have recording / capture support in 1.0.
So it looks like you request is a long way off. I asked the JMC guys
at JavaOne this year about this, so unless they had a change of heart
...

I also assume that you are building a web application in the manner as
sims-on-stage where you the web site records or like youtube with a
web camera. Obviously any Java model will need the same the security
implementation. The user is asked before the app can access a
microphone or a web camera ...
I am unsure if these interfaces like Java USB or Java Firewire
actually exist at mo in the wild or internally at Sun ...


>
>>
>> Phil.
>>
>> On 23 Sep 2008, at 14:12, "Riccardo Tacconi" <rtac...@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > does anybody knows if it is possible to stream audio with Javafx?
>> > What is the best solution for streaming audio with Java in a web
>> > application?
>> >
>> > Thanks,
>> >
>> > --
>> > Riccardo Tacconi
>> > VIRUTELOGIC LIMITED
>> >
>> > Linux user: #400461
>> >
>> > >
>>
>>
>
>
>
> --
> Riccardo Tacconi
> VIRUTELOGIC LIMITED
>
> Linux user: #400461
>
> >
>

--
Peter A. Pilgrim
Java EE Software Development / Design / Architecture (``A Sun Java Champion'')

:: http://jroller.com/peter_pilgrim ::
:: http://jroller.com/javawug ::
:: https://java-champions.dev.java.net/
:: http://www.linkedin.com/in/peterpilgrim2000
:: http://www.facebook.com/profile.php?id=570597454
:: http://twitter.com/peter_pilgrim
:: A Sun Certified Enterprise Architect for Java EE 5 platform

Phil Haigh

unread,
Sep 23, 2008, 3:04:11 PM9/23/08
to jav...@googlegroups.com
I'm going a bit off the original topic... there is JSR for USB support
but no implementation from Sun, or any sign of when it might get done.
I was looking at getting into device synchronisation software - Java
based naturally - but the complete lack of a cross-platform USB API
really killed this dead.

I don't think that the USB model is very straightforward and this is
why I suspect the API hasn't been addressed. I played with SyncML over
Bluetooth on Windows a couple of years back (great idea very poorly
documented) and half the time Windows would 'grab' the USB bluetooth
dongle even when it didn't need to, and there was no obvious way to
get it to relinquish it to the Java bluetooth stack. I think the
problem is in the fundamental USB model. You plug a USB device in and
the OS recognises it and loads up the appropriate drivers. These may
or may not pre-allocate the hardware to something and getting
resources freed up from within Java is next to impossible.

Cheers,
Phil.

Phil Haigh
Tel: +44 (0)1952 248040
Mob: +44 (0)789 0042675
Mail: ph...@haigh-family.com

Riccardo Tacconi

unread,
Sep 23, 2008, 5:49:39 PM9/23/08
to jav...@googlegroups.com
So I will have to wait for this feature. Probably I should learn and use Flex. The JMF was not so bed, but it seems to be dead. I have tested JMF with desktop application, but I am not sure if it could capture audio in an applet. Thanks for the help.

Dave Snowdon

unread,
Sep 24, 2008, 5:24:23 AM9/24/08
to jav...@googlegroups.com
You can capture audio from an applet (and process it locally or send it to a web server) - I did this on a project I completed a year or so ago.

In order for this to work the applet must be signed.

There is some example code out there but I can't remember the link right now. If anyone's interested I'll look it up and post it when I get home this evening. There are several people selling applets that do this but I'd steer clear of them.

BTW I think this is one area that Java does win over Flash - with Flash you can capture audio but it must be streamed to a server over Adobe's proprietary protocol and you can't do any local processing (for example to use a specific audio codec). There is the open source red5 server as an alternative to Adobe's (expensive) commercial server but you may not wish to run yet another server just to be able to accept streaming audio.

Dave

2008/9/23 Riccardo Tacconi <rtac...@gmail.com>

Peter Pilgrim

unread,
Sep 24, 2008, 5:35:37 AM9/24/08
to jav...@googlegroups.com
2008/9/24 Dave Snowdon <dave.s...@gmail.com>:

> You can capture audio from an applet (and process it locally or send it to a
> web server) - I did this on a project I completed a year or so ago.
>

Dave

Wow! This is news to me and all.

> In order for this to work the applet must be signed.
>

Yes but of course, if the applets to access to the client resources

> There is some example code out there but I can't remember the link right
> now. If anyone's interested I'll look it up and post it when I get home this
> evening. There are several people selling applets that do this but I'd steer
> clear of them.
>

Did this example code use the existing JMF library? If not, what
libraries was it using to do this?

> BTW I think this is one area that Java does win over Flash - with Flash you
> can capture audio but it must be streamed to a server over Adobe's
> proprietary protocol and you can't do any local processing (for example to
> use a specific audio codec). There is the open source red5 server as an
> alternative to Adobe's (expensive) commercial server but you may not wish to
> run yet another server just to be able to accept streaming audio.
>

This sounds like this Java applet solution might have something to do
with FFMPEG and all of its friends to me. I bet someone has written
Java wrapper around those native libraries. Am I right about that?

Codecs are a mess of legalities, regimes and technology continents!
Lets hope that Sun does the business with a cross platform codec for
Java that will solve the disparity with media delivery
(http://multimedia.cx/eggs/javafx-and-on2-truemotion/)

Riccardo Tacconi

unread,
Sep 24, 2008, 5:36:07 AM9/24/08
to jav...@googlegroups.com
Dave,

This is very interesting. I still see Flash as a toy tool, with very restricted option. It is interesting to hear that there is a open source server for flash streaming. Last year I have made an experiment. I had two PCs, one VIA embedded platform, powerd by a lead battery, with a wireless bridge and a web cam and Xubuntu as OS. The embedded PC was streaming to a workstation with Linux and Windows. In the end I had a mobile platform able to stream video in real-time. The problem is still JMF which is realy old and not yet developed.

When you will have the time, it would be nice is you can post some links.

Thanks.

Riccardo Tacconi

unread,
Sep 24, 2008, 5:39:35 AM9/24/08
to jav...@googlegroups.com
To solve the lack of a good audio/video platform there are some open source projects. If I recall right one is based on FFMPEG, as Peter said, but there is a binding to OpenCV, good for video processing but without streaming functionalities.

Riccardo Tacconi

unread,
Sep 24, 2008, 5:53:02 AM9/24/08
to jav...@googlegroups.com
I have found an interesting web site, accessed some months ago: http://fmj-sf.net

The features are: "FMJ is an open-source project with the goal of providing an alternative to Java Media Framework (JMF), while remaining API-compatible with JMF. It aims to produce a single API/Framework which can be used to capture, playback, process, and stream media across multiple platforms. "

Dave Snowdon

unread,
Sep 24, 2008, 5:26:13 PM9/24/08
to jav...@googlegroups.com
Hi folks

The original demo audio recording applet was at http://www.jsresources.org/am/
However, this page does not seems to exist any more.

I still have a copy of the presentation by Florian Bomers & Mathias Pfisterer and the example applet and have put the code and presentation on-line at:
http://www.emptiness.org/answerphone/answerphone.zip
in case anyone wants a look.

Please note this is not the code I actually deployed myself although the project used this example as a starting point. Most of the differences relate to the UI and the fact we didn't use the GSM codec that the demo applet includes. I seem to remember that the demo applet has a couple of thread related UI bugs as well (Swing init).

I'm not at liberty to share the code I deployed for my client (it was used on www.lifehouse-method.com which sadly was taken offline a couple of months ago) but I'll try and answer any questions you might have about the example code - the included presentation does explain pretty much everything though.

cheers

Dave

2008/9/24 Dave Snowdon <dave.s...@gmail.com>

Riccardo Tacconi

unread,
Sep 25, 2008, 9:49:23 AM9/25/08
to jav...@googlegroups.com
Dave,

Thanks a lot! I have dowloaded the zip file and the docs are really interesting.

Dave Snowdon

unread,
Sep 25, 2008, 1:11:53 PM9/25/08
to jav...@googlegroups.com
Hi Riccardo
I'm glad to be of help. If you have any problems with the code let me know and I'll see if I can assist.

Dave

2008/9/25 Riccardo Tacconi <rtac...@gmail.com>

Riccardo Tacconi

unread,
Sep 29, 2008, 9:56:22 AM9/29/08
to jav...@googlegroups.com
I have tryed some code and it is working fine. I am wondering how to transmit the audio captured to a server using RTP. I know that only JMF has RTP streaming libraries available. So I am not sure if I should use only JMF for capturing and streaming.
Reply all
Reply to author
Forward
0 new messages