Re: Media player maturity (on Mac)

2015-03-13 Thread Robert Krüger
On Thu, Mar 12, 2015 at 8:48 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!
>
> 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...
>
>
Good to know, thanks.


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

I can imagine resources quite stretched for a huge project like this. Maybe
JFX10 then ;-).


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: 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?


Re: Media player maturity (on Mac)

2015-03-11 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.
>
> I already tested uncompressed (wav).


Re: Media player maturity (on Mac)

2015-03-11 Thread David DeHaven

> 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-



Re: Media player maturity (on Mac)

2015-03-11 Thread Scott Palmer
Now that you mention this, I remember having a problem with JavaFX audio on my 
Mac - where I believe playback wasn't working at all, and that was also 
resolved with a reboot. That was some time ago, with an older version of FX and 
the OS for that matter.

Scott

> On Mar 11, 2015, at 6:42 AM, Robert Krüger  wrote:
> 
> I can also no longer reproduce the looping failure after my last reboot :-S.
> 


Re: Media player maturity (on Mac)

2015-03-11 Thread Robert Krüger
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.

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.

@Joe: I am using 10.10.1, just realized I never answered that

Best regards,

Robert


On Wed, Mar 11, 2015 at 2:51 AM, David DeHaven 
wrote:

>
> > anyone doing serious work with the media player on the Mac? I am
> > experimenting and so far I am not getting the impression, this is really
> > something very solid.
> >
> > The first Audio-Sample I tried playing plays fine the first time but
> when I
> > play it for a second time by either issuing stop() followed by play() or
> > seek(new Duration(0) and then play, the playback cuts off a few samples
> at
> > the start (does not happen when I instantiate a new Player for each time
> I
> > want to play it, which does not feel right). You need a suitable audio
> file
> > like a drum beat that starts immediately in the file to notice the
> > difference.
> >
> > If one was to implement simple sample-player-like functionality (not a
> full
> > fledged music sequencer but something that allows timed playback to
> arrange
> > sounds on a timeline a bit) in JavaFX, should Mediaplayer be the tool to
> > use or do I have to use native APIs? Last time I checked JavaSound, it
> was
> > still an abandoned toy usable only for educational purposes but not for
> > anything else. Don't know if that has changed or if this is even the
> Audio
> > strategy for JFX.
> >
> > Would be great if someone could share experience/opinions in this area.
>
> Have you tried AudioClip instead of MediaPlayer?
>
> -DrD-
>
>


-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com


Re: Media player maturity (on Mac)

2015-03-10 Thread David DeHaven

> anyone doing serious work with the media player on the Mac? I am
> experimenting and so far I am not getting the impression, this is really
> something very solid.
> 
> The first Audio-Sample I tried playing plays fine the first time but when I
> play it for a second time by either issuing stop() followed by play() or
> seek(new Duration(0) and then play, the playback cuts off a few samples at
> the start (does not happen when I instantiate a new Player for each time I
> want to play it, which does not feel right). You need a suitable audio file
> like a drum beat that starts immediately in the file to notice the
> difference.
> 
> If one was to implement simple sample-player-like functionality (not a full
> fledged music sequencer but something that allows timed playback to arrange
> sounds on a timeline a bit) in JavaFX, should Mediaplayer be the tool to
> use or do I have to use native APIs? Last time I checked JavaSound, it was
> still an abandoned toy usable only for educational purposes but not for
> anything else. Don't know if that has changed or if this is even the Audio
> strategy for JFX.
> 
> Would be great if someone could share experience/opinions in this area.

Have you tried AudioClip instead of MediaPlayer?

-DrD-



Re: Media player maturity (on Mac)

2015-03-09 Thread Scott Palmer
As you have discovered, the JavaFX media support isn't quite where it needs to 
be. That said, the JavaFX team is putting in the effort to make JavaFX better 
with every release.  Please do file that bug report!

(This kind of issue is sure to get addressed faster than my request to make the 
media system extensible RT-2684)


Scott

> On Mar 9, 2015, at 6:49 PM, Robert Krüger  wrote:
> 
> Doesn't seem to make a difference if I use u25 or u40.
> 
> I can't get any sound file to loop using setCycleCount(INDEFINITE) on u25
> or u40 either.
> 
> I will probably submit bug reports for this later.
> 
> 
>> On Mon, Mar 9, 2015 at 6:01 PM, Joe McGlynn  wrote:
>> 
>> The FX/Media stack is supported, and the media stack on Mac was *just*
>> updated in 8u40 to use the newer AVFoundation stack (10.8+ only) instead of
>> QtKit.  It’s certainly possible there are bugs, please file a bug report
>> with a reproducer case so we can fix them.
>> 
>> 
>> 
>> 
>> 
>> On Mar 9, 2015, at 9:31 AM, Robert Krüger  wrote:
>> 
>> Hi,
>> 
>> anyone doing serious work with the media player on the Mac? I am
>> experimenting and so far I am not getting the impression, this is really
>> something very solid.
>> 
>> The first Audio-Sample I tried playing plays fine the first time but when I
>> play it for a second time by either issuing stop() followed by play() or
>> seek(new Duration(0) and then play, the playback cuts off a few samples at
>> the start (does not happen when I instantiate a new Player for each time I
>> want to play it, which does not feel right). You need a suitable audio file
>> like a drum beat that starts immediately in the file to notice the
>> difference.
>> 
>> If one was to implement simple sample-player-like functionality (not a full
>> fledged music sequencer but something that allows timed playback to arrange
>> sounds on a timeline a bit) in JavaFX, should Mediaplayer be the tool to
>> use or do I have to use native APIs? Last time I checked JavaSound, it was
>> still an abandoned toy usable only for educational purposes but not for
>> anything else. Don't know if that has changed or if this is even the Audio
>> strategy for JFX.
>> 
>> Would be great if someone could share experience/opinions in this area.
>> 
>> Thanks in advance,
>> 
>> Robert
> 
> 
> -- 
> Robert Krüger
> Managing Partner
> Lesspain GmbH & Co. KG
> 
> www.lesspain-software.com


Re: Media player maturity (on Mac)

2015-03-09 Thread Robert Krüger
Doesn't seem to make a difference if I use u25 or u40.

I can't get any sound file to loop using setCycleCount(INDEFINITE) on u25
or u40 either.

I will probably submit bug reports for this later.


On Mon, Mar 9, 2015 at 6:01 PM, Joe McGlynn  wrote:

> The FX/Media stack is supported, and the media stack on Mac was *just*
> updated in 8u40 to use the newer AVFoundation stack (10.8+ only) instead of
> QtKit.  It’s certainly possible there are bugs, please file a bug report
> with a reproducer case so we can fix them.
>
> 
>
> 
>
> On Mar 9, 2015, at 9:31 AM, Robert Krüger  wrote:
>
> Hi,
>
> anyone doing serious work with the media player on the Mac? I am
> experimenting and so far I am not getting the impression, this is really
> something very solid.
>
> The first Audio-Sample I tried playing plays fine the first time but when I
> play it for a second time by either issuing stop() followed by play() or
> seek(new Duration(0) and then play, the playback cuts off a few samples at
> the start (does not happen when I instantiate a new Player for each time I
> want to play it, which does not feel right). You need a suitable audio file
> like a drum beat that starts immediately in the file to notice the
> difference.
>
> If one was to implement simple sample-player-like functionality (not a full
> fledged music sequencer but something that allows timed playback to arrange
> sounds on a timeline a bit) in JavaFX, should Mediaplayer be the tool to
> use or do I have to use native APIs? Last time I checked JavaSound, it was
> still an abandoned toy usable only for educational purposes but not for
> anything else. Don't know if that has changed or if this is even the Audio
> strategy for JFX.
>
> Would be great if someone could share experience/opinions in this area.
>
> Thanks in advance,
>
> Robert
>
>
>


-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com


Re: Media player maturity (on Mac)

2015-03-09 Thread Joe McGlynn
The FX/Media stack is supported, and the media stack on Mac was *just* updated 
in 8u40 to use the newer AVFoundation stack (10.8+ only) instead of QtKit.  
It’s certainly possible there are bugs, please file a bug report with a 
reproducer case so we can fix them.
 

 
> On Mar 9, 2015, at 9:31 AM, Robert Krüger  wrote:
> 
> Hi,
> 
> anyone doing serious work with the media player on the Mac? I am
> experimenting and so far I am not getting the impression, this is really
> something very solid.
> 
> The first Audio-Sample I tried playing plays fine the first time but when I
> play it for a second time by either issuing stop() followed by play() or
> seek(new Duration(0) and then play, the playback cuts off a few samples at
> the start (does not happen when I instantiate a new Player for each time I
> want to play it, which does not feel right). You need a suitable audio file
> like a drum beat that starts immediately in the file to notice the
> difference.
> 
> If one was to implement simple sample-player-like functionality (not a full
> fledged music sequencer but something that allows timed playback to arrange
> sounds on a timeline a bit) in JavaFX, should Mediaplayer be the tool to
> use or do I have to use native APIs? Last time I checked JavaSound, it was
> still an abandoned toy usable only for educational purposes but not for
> anything else. Don't know if that has changed or if this is even the Audio
> strategy for JFX.
> 
> Would be great if someone could share experience/opinions in this area.
> 
> Thanks in advance,
> 
> Robert