In the current Java 8 JDK (update 51) and in previous versions I noticed strange behaviour regarding the audio output of the JavaFX MediaPlayer under Linux (Ubuntu 14.04 LTS). If you try to play an MPEG4 video with AAC audio with dual audio sampling rates Java seems to mess up something because the **playback sound gets pitched low** (voices are deep) but the speed stays constant. If you set MediaPlayers playback rate to 2x speed the pitch is normal, but of course speed is doubled up.
I don't know if this is a Java bug or a Linux codec problem. I also tried to install several video and audio codecs for Ubuntu (i.e. ubuntu-restricted-extras). I also could not find anything on the internet refering to this problem. I am wondering if there is a workaround for this? Maybe by setting the sampling rate manually for the media (but how?)?
I would like to provide an example MP4 file but I could not find any free on the net with dual sampling rates. All I can provide is the output of `mediainfo` (by Tektronix) for the media the problem occurs on, which says:
First audio stream:
64.0 Kbps, 48.0 KHz / 24.0 KHz, 2 channels, AAC (HE-AAC / LC)
Note the given dual audio sampling rates: 48.0 KHz / 24.0 KHz
This problem does not occur on Windows platforms!
The problem also occurs if you try to play the media by using the Java Webkits HTML5 video player (<video></video>).