Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To play aac in javafx

 
Prince Rajan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to .aac audio file in javafx?


When i tried it showed wrror msg below:
Caused by: MediaException: MEDIA_UNSUPPORTED : Unrecognized file signature!
at javafx.scene.media.Media.<init>(Media.java:411)
at javafxapplication1.JavaFXApplication1.start(JavaFXApplication1.java:29)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
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)
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, aac is encoded media is supported (in an mp4 or http live streaming container).

You can find the information on supported media types in the media package javadoc:
  https://docs.oracle.com/javase/8/javafx/api/javafx/scene/media/package-summary.html

If you are using Linux you must have the appropriate media codecs pre-installed, see the certified system configurations:
  http://www.oracle.com/technetwork/java/javase/certconfig-2095354.html

If you continue to encounter playback errors, implement all of the error handling logic which is detailed in the media package javadoc.
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note if your aac file is not an mp4 container, you will need to convert it to mp4 (you can google conversion tools). 
Also, if the aac file is protected by DRM (such as FairPlay https://en.wikipedia.org/wiki/FairPlay), then you won't be able to play it back using JavaFX.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic