Re: Media player maturity (on Mac)

2015-03-12 Thread David DeHaven

> > One more question regarding this. Is it OK to have many instances of 
> > AudioClip or MediaPlayer if only a few of them actually play stuff or do 
> > they block audio resources even when they are stopped?
> 
> You can have as many as memory will allow :) They don’t tie up hardware 
> resources until actually playing. I actually recommend pre-loading AudioClips 
> to avoid startup latency, especially if they’re fetched remotely.
> 
> Thanks for the info! 

Oh, and if you have a lot of AudioClips, it’s best to spawn a new thread to 
load them up asynchronously, otherwise you could block the main application 
thread which will render the UI unresponsive while it’s loading. We’ve seen 
this happen on a couple occasions...

I wanted to provide a library API to handle pre-loading, but didn’t have the 
time or resources :(

-DrD-



Re: MediaPlayer status changes

2015-03-12 Thread David DeHaven

> I don't see anything in the docs stating how status should change in
> MediaPlayer, e.g. will reaching end of media trigger a transition from
> PLAYING to STOPPED? Will a subsequent call to play() start at the beginning
> of the media file or do I need to seek? I was expecting some kind of status
> change on end of media but am not seeing any when playing back an audio
> sample until the end and when I checked the api doc, I didn't find anything
> (e.g. like a state diagram) to check if it's a bug or documented behavior.


The formal documentation is here (read the package Description, link at the 
top):
http://docs.oracle.com/javase/8/javafx/api/javafx/scene/media/package-summary.html

There’s actually a flow chart in the docs for MediaPlayer.Status:
http://docs.oracle.com/javase/8/javafx/api/javafx/scene/media/MediaPlayer.Status.html

Hope that helps.

-DrD-



[8u60] review request: RT-40254: Allow building with gradle 2.X

2015-03-12 Thread Kevin Rushforth

Dave,

Please review the following:

https://javafx-jira.kenai.com/browse/RT-40254

This change will allow building with gradle 2.X, although 1.8 is still 
the default (this will not change in FX 8u). Tested with gradle 1.8 and 2.3.


-- Kevin



MediaPlayer status changes

2015-03-12 Thread Robert Krüger
Hi,

I don't see anything in the docs stating how status should change in
MediaPlayer, e.g. will reaching end of media trigger a transition from
PLAYING to STOPPED? Will a subsequent call to play() start at the beginning
of the media file or do I need to seek? I was expecting some kind of status
change on end of media but am not seeing any when playing back an audio
sample until the end and when I checked the api doc, I didn't find anything
(e.g. like a state diagram) to check if it's a bug or documented behavior.

Regards,

Robert


Re: Media player maturity (on Mac)

2015-03-12 Thread Robert Krüger
On Thu, Mar 12, 2015 at 6:02 PM, David DeHaven 
wrote:

>
> > One more question regarding this. Is it OK to have many instances of
> AudioClip or MediaPlayer if only a few of them actually play stuff or do
> they block audio resources even when they are stopped?
>
> You can have as many as memory will allow :) They don’t tie up hardware
> resources until actually playing. I actually recommend pre-loading
> AudioClips to avoid startup latency, especially if they’re fetched remotely.
>

Thanks for the info!


Re: Media player maturity (on Mac)

2015-03-12 Thread David DeHaven

> One more question regarding this. Is it OK to have many instances of 
> AudioClip or MediaPlayer if only a few of them actually play stuff or do they 
> block audio resources even when they are stopped?

You can have as many as memory will allow :) They don’t tie up hardware 
resources until actually playing. I actually recommend pre-loading AudioClips 
to avoid startup latency, especially if they’re fetched remotely.

-DrD-



Re: Media player maturity (on Mac)

2015-03-12 Thread Robert Krüger
On Wed, Mar 11, 2015 at 5:28 PM, David DeHaven 
wrote:

>
> > No, thanks for the hint. I just did and the behavior is a bit better in
> the sense that the sample start is not cut off on subsequent play
> invocations (behaves more or less line instantiating a new mediaplayer for
> each invocation, which is good) but when I loop using setCycleCount the
> sample start is also not clean (seams to be varying, though).
> >
> > For my uses case I will probably need both MediaPlayer and Audioclip,
> because I have typical cases for AudioClip (e.g. short notification sounds)
> and long looping background samples.
> >
> > Wow, I just discovered, that the behavior with the sample start sounding
> different on the first invocation also happens when I play the sample using
> the player integrated in Finder, so I owe you a big apology. I am sorry! I
> can also no longer reproduce the looping failure after my last reboot :-S.
>
> No worries, these things just aren’t supposed to behave that way ;)
>
>
> > Btw. the latency of AudioClip on the Mac (2012 MBP) is not quite low
> enough to implement something like a drum kit using the keyboard. I don't
> know if that is the benchmark you are after or if that is also a limitation
> of the hosting system. I need to test that with other applications. The
> latency I get with AudioClip is good enough for my current use case, though.
>
> Yeah, the current AudioClip implementation actually uses the same engine
> as MediaPlayer, just in a slightly different way. The biggest difference
> (aside from the one-shot interface) is it caches all the audio data in
> memory. If you use uncompressed audio (aiff) it will be a bit faster.
>
> -DrD-
>
>
One more question regarding this. Is it OK to have many instances of
AudioClip or MediaPlayer if only a few of them actually play stuff or do
they block audio resources even when they are stopped?