Closed jkothamb closed 10 months ago
I would set a breakpoint in AudioSystem.getAudioInputStream(...)
, right in the first line of that method and step through it.
Take note of which AudioFileReader
s are installed/found on your system. FFAudioFileReader
should be one of them. Are there any messages in std out or the like?
However, to get some more info from FFSampled, turn on java.util.logging
. See for example https://stackoverflow.com/a/73227419/942774
Hi @hendriks73 : thanks for getting back. It works perfectly fine on mac (development environment), but not on amazon linux where we deploy our application to run as a k8s container. It would be difficult to breakpoint there, but can certainly turn on more logging.
Hi, after changing the log level for com.tagtraum.ffsampledsp to TRACE, still no logs
Exception in thread "main" javax.sound.sampled.UnsupportedAudioFileException: File of unsupported format at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1066) at ai.XXXX.privaci.utils.audio.AudioUtils.readAudioFile(AudioUtils.java:62) at ai.XXXX.privaci.utils.audio.WhisperTest.main(WhisperTest.java:16)
Are you certain it's in the class path?
Try calling com.tagtraum.ffsampledsp.FFNativeLibraryLoader.loadLibrary()
. It should produce some log output.
hi @hendriks73 : I was able to get the necessary logs
`Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader arch INFO: Using arch=x86_64
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINEST: loadLibrary("ffsampledsp", class com.tagtraum.ffsampledsp.FFNativeLibraryLoader)
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINE: packagedNativeLib: ffsampledsp-x86_64-linux.so
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINE: Trying Runtime.getRuntime().load("/tmp/ffsampledsp-x86_64-linux-0.9.53.so")
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINE: Failed to load /tmp/ffsampledsp-x86_64-linux-0.9.53.so (will try other ways): java.lang.UnsatisfiedLinkError: /tmp/ffsampledsp-x86_64-linux-0.9.53.so: libbz2.so.1.0: cannot open shared object file: No such file or directory
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINE: Trying System.loadLibrary("ffsampledsp-x86_64-linux")
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary FINE: Trying System.loadLibrary("ffsampledsp")
Oct 27, 2023 5:01:40 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader loadLibrary SEVERE: Failed to load native library 'ffsampledsp'. Please check your library path. FFSampledSP will be dysfunctional.`
It seems, ffsampledsp is dynamically linked to bzip2.
Can you please try to install bzip2-dev on your Amazon system?
sudo yum install libbz2-dev
or
sudo dnf install libbz2-dev
Should do the trick. Does it fix the issue?
(there may be a similar issue with libz
)
And I guess I should consider statically linking both compression libraries.
Or perhaps
sudo yum install bzip2
or
sudo dnf install bzip2
Don't know.
hi @hendriks73 : installing libbz2 certainly fixed the issue. I am able to load audio files of different formats. Had to add a symlink for libbz2.so file to make it work. Thanks for all the help.
No problem.
Can you say which link you created? The exact statement? For others who run into the same issue?
it was below
ln -snf /usr/lib64/libbz2.so.1.0.8 /usr/lib64/libbz2.so.1.0
Hi Hendrik,
I want to use ffsampledsp-complete version 0.9.53 on amazon linux, but it fails with below error for mp3 as well as for other audio format files. Not sure how do I go about debugging this. Any help is appreciated