Skip to main content

Playing sounds

10 replies [Last post]
francoislionet
Offline
Joined: 2008-01-13
Points: 0

Hello,

In the HD Cookbook, to play sound it is said that you can either use the HSound object, or create a JMF player.
What is a JMF player? I have tried to look in the doc, I have found anything like "Media F..."
Can you direct me to the proper classes and doc?

Thanks, Francois

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi,

If it helps our tool DoStudio MX Authoring Edition (DSA) for BD will hve this feature built in but this is not a standalone tool. The early access program information can be found here: http://dostudio.netblender.com/earlyaccess.asp

Cheers,

Denny B.
------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio MX Team - NDS - http://dostudio.netblender.com[/i]

Philip Starner

I think for the book they were made by Sonic Tool. Currently the Sonic tool
does not handle Mono audio very well and we have recieved another tool, that
will take care of the job ok. The drawback to this tool is it outputs only
one WAV file to a sound.bdmv, and hence (BD://SOUND:00) is the only sound
reference you can make to the file. Also sound.bdmv is really a bundle of
PCM files.

We don't use HAVi for sound anymore, but much prefer the JMF flavor. This
is because you can add gain and panning to a JMF player.

We have a tool called Wav2Sound as a little executable, but I believe it
came from Sonic, so I don't feel comfortable distributing it. Maybe if you
contact them, they could distribute it.

thx,
Phil

On 2/26/08, Bill Foote wrote:
>
> (Phil, question for you below...)
>
> bd-j-dev@mobileandembedded.org wrote:
> > Thanks for the info.
> > Do you mean, it is impossible to embed sounds in the JAR file? This
> would be a lot simpler for me. I think the media framework has methods to
> load sounds from within the jar.
>
>
> Right. If you can get a File object (e.g. from a mounted jar),
> you can use the method on java.io.File that converts it into
> a URL. From there, I think one path is MediaLocator -> Locator.
>
> > I have tried so far to create a HSound, and then use the load method to
> loa the sound. And I get a NullPointerException in
> javax.media.Manager.createPlayer. So deep inside the method call.
> Something is wrong.
> >
> > Bill, do you know of any tool that can create the sound.mdmv file?
>
>
> Right, sound.bdmv is the key.
>
> I remember that it's not so difficult, but I don't think
> I have something ready that does it.
>
> Phil, was it you who made the sound.bdmv file for the cookbook?
> Do you remember how we made it? I remember we started with the
> .wav files from the HD-DVD version, but I forget how we got from
> that to sound.bdmv.
>
> I think you just make individual LPCM files (which is a common enough
> file format that a lot of programs can output it), and then string
> them together with some minimal directory information; this latter
> part ought to be easy enough to code up and put in the cookbook
> repository. I'm happy to do that, but I'm too lazy to go spec
> diving, when I think I can get away with just asking Phil :-)
>
> A+,
>
> Bill
>
>
> > Francois
> > [Message sent by forum member 'francoislionet' (francoislionet)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=261009
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> > For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
> >
>
>
[att1.html]

Bill Foote

(Phil, question for you below...)

bd-j-dev@mobileandembedded.org wrote:
> Thanks for the info.
> Do you mean, it is impossible to embed sounds in the JAR file? This would be a lot simpler for me. I think the media framework has methods to load sounds from within the jar.

Right. If you can get a File object (e.g. from a mounted jar),
you can use the method on java.io.File that converts it into
a URL. From there, I think one path is MediaLocator -> Locator.

> I have tried so far to create a HSound, and then use the load method to loa the sound. And I get a NullPointerException in javax.media.Manager.createPlayer. So deep inside the method call. Something is wrong.
>
> Bill, do you know of any tool that can create the sound.mdmv file?

Right, sound.bdmv is the key.

I remember that it's not so difficult, but I don't think
I have something ready that does it.

Phil, was it you who made the sound.bdmv file for the cookbook?
Do you remember how we made it? I remember we started with the
.wav files from the HD-DVD version, but I forget how we got from
that to sound.bdmv.

I think you just make individual LPCM files (which is a common enough
file format that a lot of programs can output it), and then string
them together with some minimal directory information; this latter
part ought to be easy enough to code up and put in the cookbook
repository. I'm happy to do that, but I'm too lazy to go spec
diving, when I think I can get away with just asking Phil :-)

A+,

Bill

> Francois
> [Message sent by forum member 'francoislionet' (francoislionet)]
>
> http://forums.java.net/jive/thread.jspa?messageID=261009
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

2themax
Offline
Joined: 2008-01-22
Points: 0

Scenarist BD-J includes a utility that converts WAV to BDMV. It's located in the Utilities folder in the Scenarist BD-J folder. I've used it and the conversion works and plays fine on both PC players and stand-alones.

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi Francoislionet,

It is the Java Media Framework and you can learn more about it here: http://java.sun.com/products/java-media/jmf/
Also there are a lot of samples on the net, when it first came out people were creating their own Audio players (mainly MP3 players) with it.

Cheers,

Denny B.
------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio MX Team - NDS - http://dostudio.netblender.com [/i]

francoislionet
Offline
Joined: 2008-01-13
Points: 0

Thank you very much for the link.
Another question : what are the formats supported by JMF in BluRay players? For sounds, is it uncompressed WAV files? Does it support MIDI (I wish it did!)

Francois

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi francoislionet,

I'm sorry I might have mislead you with the reference to the JMF API. Sadly to say the supported audio format is Linear PCM audio files and they are stored inside a file sound.bdmv and are loaded like this:

javax.media.Player audioPlayer = javax.media.Manager.createPlayer(new javax.media.MediaLocator("bd://SOUND:00"));
audioPlayer.prefetch();
//The Player uses the same start up states as the player used to control the main video playback.

Unfortunately I do not know of any standalone tools that create the sound.bdmv file. Maybe someone else does.

Hope this helps,

Denny B.
------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio MX Team - NDS - http://dostudio.netblender.com[/i]

francoislionet
Offline
Joined: 2008-01-13
Points: 0

Thanks for the info.
Do you mean, it is impossible to embed sounds in the JAR file? This would be a lot simpler for me. I think the media framework has methods to load sounds from within the jar.

I have tried so far to create a HSound, and then use the load method to loa the sound. And I get a NullPointerException in javax.media.Manager.createPlayer. So deep inside the method call. Something is wrong.

Bill, do you know of any tool that can create the sound.mdmv file?

Francois

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi francoislionet,

You can store pcm files directly in your .jar file or in a folder and then load them like this:

org.havi.ui.HSound mySound = new org.havi.ui.Hsound();
String mySoundFilePath = "\\VFS\\BDMV\\JAR\\00005\\myaudio.pcm";
mySound.load(mySoundFilePath);
//once loaded
mySound.play();

Hope this helps,

Denny B.
------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio MX Team - NDS - http://dostudio.netblender.com[/i]

bjoern_minkmar
Offline
Joined: 2007-06-11
Points: 0

Hi Francois,

if you have the sound in the same jar-file (named 00000.jar for example) that your application is in, you can also use the following lines:

BDLocator bdl = new BDLocator("bd://JAR:00000/myAudio.pcm");
MediaLocator ml = new MediaLocator(bdl);
HSound sound = new HSound();
sound.load(ml.getURL());
sound.play();

At least it works in PowerDVD. Haven't tested it on hardware players so far.