Re: Playing a sound at regular intervals

2016-08-23 Thread Scott Palmer

FYI... This issue is not visible to me 
https://bugs.openjdk.java.net/browse/JDK-8090414


Scott

> On Aug 23, 2016, at 10:15 AM, David DeHaven  wrote:
> 
> 
>> We're trying to play a notification sound at a regular interval (every 
>> 500ms) in a loop.
>> 
>> It should sound like "bing.bing.bing." and not like 
>> "bing..bing..bing...bing" if you know what I mean ;)
>> 
>> From the JavaDoc we were guessing that an efficient way to do this would be 
>> to set cycle count to indefinite on the audio clip / on the media player and 
>> call play() once.
>> 
>> Observations:
>> - Cycle count doesn't work for mp3 files. No problem, just use WAV.
>> - The playback does not happen at regular intervals. -> not usable in this 
>> scenario
>> 
>> Our solution so far has been to have a scheduled executor which calls 
>> audioclip.play() every 500 ms. This creates a new thread every time (see 
>> stack trace below) and we don't like this approach.
> 
> For the moment this is a better solution, until we can get a few internal 
> things fixed in AudioClip.
> 
> In the current implementation there will always be at least one new thread 
> created.
> 
> 
> There are bugs filed on this already, specifically:
> https://bugs.openjdk.java.net/browse/JDK-8090414
> https://bugs.openjdk.java.net/browse/JDK-8087423
> 
> And possibly related:
> https://bugs.openjdk.java.net/browse/JDK-8088375
> 
> -DrD-
> 


Re: Playing a sound at regular intervals

2016-08-23 Thread David DeHaven

> We're trying to play a notification sound at a regular interval (every 500ms) 
> in a loop.
> 
> It should sound like "bing.bing.bing." and not like 
> "bing..bing..bing...bing" if you know what I mean ;)
> 
> From the JavaDoc we were guessing that an efficient way to do this would be 
> to set cycle count to indefinite on the audio clip / on the media player and 
> call play() once.
> 
> Observations:
> - Cycle count doesn't work for mp3 files. No problem, just use WAV.
> - The playback does not happen at regular intervals. -> not usable in this 
> scenario
> 
> Our solution so far has been to have a scheduled executor which calls 
> audioclip.play() every 500 ms. This creates a new thread every time (see 
> stack trace below) and we don't like this approach.

For the moment this is a better solution, until we can get a few internal 
things fixed in AudioClip.

In the current implementation there will always be at least one new thread 
created.


There are bugs filed on this already, specifically:
https://bugs.openjdk.java.net/browse/JDK-8090414
https://bugs.openjdk.java.net/browse/JDK-8087423

And possibly related:
https://bugs.openjdk.java.net/browse/JDK-8088375

-DrD-



NullPointerException in LabeledSkinBase

2016-08-23 Thread Rahman USTA
Hello;

I got this NullPointerException in my JavaFX application, but it is not
reproducible.

OS: Windows 7
Ver: Microsoft Windows [Version 6.1.7601]

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

java.lang.NullPointerException
at
com.sun.javafx.text.PrismTextLayout.shape(PrismTextLayout.java:869)
at
com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1064)
at
com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:223)
at
com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:246)
at
com.sun.javafx.scene.control.skin.Utils.computeTextWidth(Utils.java:120)
at
com.sun.javafx.scene.control.skin.LabeledSkinBase.computeMinLabeledPartWidth(LabeledSkinBase.j
ava:661)
at
com.sun.javafx.scene.control.skin.LabeledSkinBase.computeMinWidth(LabeledSkinBase.java:633)
at javafx.scene.control.Control.computeMinWidth(Control.java:470)
at javafx.scene.Parent.minWidth(Parent.java:943)
at javafx.scene.layout.Region.minWidth(Region.java:1383)
at
javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1667)
at javafx.scene.layout.HBox.getAreaWidths(HBox.java:455)
at javafx.scene.layout.HBox.computeContentWidth(HBox.java:532)
at javafx.scene.layout.HBox.computeMinWidth(HBox.java:402)
at javafx.scene.Parent.minWidth(Parent.java:943)
at javafx.scene.layout.Region.minWidth(Region.java:1383)
at
javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1667)
at javafx.scene.layout.HBox.getAreaWidths(HBox.java:455)
at javafx.scene.layout.HBox.computeContentWidth(HBox.java:532)
at javafx.scene.layout.HBox.computeMinWidth(HBox.java:402)
at javafx.scene.Parent.minWidth(Parent.java:943)
at javafx.scene.layout.Region.minWidth(Region.java:1383)
at
javafx.scene.layout.Region.computeChildMinAreaWidth(Region.java:1667)
at javafx.scene.layout.BorderPane.getAreaWidth(BorderPane.java:609)
at
javafx.scene.layout.BorderPane.computeMinWidth(BorderPane.java:369)
at javafx.scene.Parent.minWidth(Parent.java:943)
at javafx.scene.layout.Region.minWidth(Region.java:1383)
at
javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:484)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)
at
com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
at
com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
at
com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
at
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at
com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)


Thanks

-- 
Rahman USTA
Istanbul JUG
https://github.com/rahmanusta 


Playing a sound at regular intervals

2016-08-23 Thread Daniel Glöckner
Hi,

We're trying to play a notification sound at a regular interval (every 500ms) 
in a loop.

It should sound like "bing.bing.bing." and not like 
"bing..bing..bing...bing" if you know what I mean ;)

>From the JavaDoc we were guessing that an efficient way to do this would be to 
>set cycle count to indefinite on the audio clip / on the media player and call 
>play() once.

Observations:
- Cycle count doesn't work for mp3 files. No problem, just use WAV.
- The playback does not happen at regular intervals. -> not usable in this 
scenario

Our solution so far has been to have a scheduled executor which calls 
audioclip.play() every 500 ms. This creates a new thread every time (see stack 
trace below) and we don't like this approach.

Are there any experts for NativeMediaPlayer on this mailing list?

Kind regards,
Daniel

Daemon Thread [Thread-21] (Suspended)   
owns: NativeMediaAudioClipPlayer  (id=1523) 
NativeMediaPlayer$EventQueueThread(Thread).init(ThreadGroup, Runnable, 
String, long, AccessControlContext) line: 365
NativeMediaPlayer$EventQueueThread(Thread).init(ThreadGroup, Runnable, 
String, long) line: 349  
NativeMediaPlayer$EventQueueThread(Thread).() line: 445   
NativeMediaPlayer$EventQueueThread.(NativeMediaPlayer) line: 386  
GSTMediaPlayer(NativeMediaPlayer).(NativeMedia) line: 109 
GSTMediaPlayer.(GSTMedia) line: 46
GSTMediaPlayer.(Locator) line: 62 
GSTPlatform.createMediaPlayer(Locator) line: 121
PlatformManager.createMediaPlayer(Locator) line: 201
NativeMediaManager.getPlayer(Locator) line: 222 
MediaManager.getPlayer(Locator) line: 104   
NativeMediaAudioClipPlayer.play() line: 319 
NativeMediaAudioClipPlayer.clipScheduler() line: 112
NativeMediaAudioClipPlayer.access$000() line: 47
NativeMediaAudioClipPlayer$Enthreaderator.lambda$static$4() line: 85
2056540299.run() line: not available
Thread.run() line: 745