-
Notifications
You must be signed in to change notification settings - Fork 6
General Bug Fixes #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
General Bug Fixes #24
Conversation
Bumps ant from 1.9.4 to 1.9.15. Signed-off-by: dependabot[bot] <[email protected]>
…apache.ant-ant-1.9.15 Bump ant from 1.9.4 to 1.9.15
# Conflicts: # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
Fixed bad version numbers.
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # NOTES.md # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # NOTES.md # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # NOTES.md # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-unix/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
# Conflicts: # NOTES.md # ffsampledsp-aarch64-linux/pom.xml # ffsampledsp-aarch64-macos/pom.xml # ffsampledsp-complete/pom.xml # ffsampledsp-i386-win/pom.xml # ffsampledsp-java/pom.xml # ffsampledsp-x86_64-linux/pom.xml # ffsampledsp-x86_64-macos/pom.xml # ffsampledsp-x86_64-win/pom.xml # pom.xml
|
It looks like an encoded string in general is not supported by the ffmpeg ff_open_format_context() function for a local file. I have encountered extra FileNotFound errors with other file paths. I am in the process of writing up a fix. |
FFAudioFileReader reader = new FFAudioFileReader();
String tempStr_1 = "file:///C:/Users/Super/Downloads/temp/temp%20Again/audio.ogg";
URL url_1 = URI.create(tempStr_1).toURL();
String tempStr_2 = "file://CAMERON-NAS/home/Songs/space%20space/audio.mp3";
URL url_2 = URI.create(tempStr_2).toURL();
String file_1 = "\\\\CAMERON-NAS\\home\\Songs\\space space\\audio.mp3"; // creates a "file:////" url
String file_2 = "C:\\Users\\Super\\Downloads\\temp\\temp Again\\audio.ogg";
try {
System.out.println("URL 1");
System.out.println("Result: " + reader.getAudioFileFormat(url_1));
System.out.println("URL 2");
System.out.println("Result: " + reader.getAudioFileFormat(url_2));
System.out.println("File 1");
System.out.println("Result: " + reader.getAudioFileFormat(new File(file_1)));
System.out.println("File 2");
System.out.println("Result: " + reader.getAudioFileFormat(new File(file_2)));
} catch (UnsupportedAudioFileException | IOException e) {
e.printStackTrace();
}Jan 28, 2025 4:41:13 PM com.tagtraum.ffsampledsp.FFNativeLibraryLoader arch
INFO: Using arch=x86_64
URL 1
Result: OGG (.ogg) file, byte length: 2427072, data format: VORBIS 48000.0 Hz, unknown bits per sample, stereo, unknown frame size, unknown frame rate
URL 2
Result: MP3 (.mp3) file, byte length: 0, data format: MPEG-1, Layer 3 44100.0 Hz, unknown bits per sample, stereo, unknown frame size, 38.28125 frames/second, frame length: 9054
File 1
Result: MP3 (.mp3) file, byte length: 0, data format: MPEG-1, Layer 3 44100.0 Hz, unknown bits per sample, stereo, unknown frame size, 38.28125 frames/second, frame length: 9054
File 2
Result: OGG (.ogg) file, byte length: 2427072, data format: VORBIS 48000.0 Hz, unknown bits per sample, stereo, unknown frame size, unknown frame rate
Process finished with exit code 0Made a new fix taking into consideration general file URL decoding and tested it with the above code. |
|
Tested on linux and provided a fix for url scheme as well. Added fix for audio files without explicit extension in filename. |
Test Environment: Windows 10, Java JDK 23
ffsampledsp throws a FileNotFoundError when a path to an audio file contains a space character.
Output:
FFAudioFileReader -> urlToString(final URL url) is called to convert the URL to a valid string input for FFmpeg:
Working input url: file:/C:/Users/Super/Downloads/temp/audio.ogg
Non-Working input: file:/C:/Users/Super/Downloads/temp/temp%20Again/audio.ogg
The native
ff_open_format_context()function within FFUtils.c throws the FileNotFoundError in question.It seems that although
file:/C:/Users/Super/Downloads/temp/temp%20Again/audio.oggthe %20 encoded space character is valid in Windows (I am able to paste this url into file explorer and run the file), it does not seem to be valid in the FFmpeg library you are using.I have added extra decoding to the
urlToString()function to replace %20 with a space character, and this seems to have fixed the issue.I tested the fix on the main branch.
I also packaged the library into a jar, and added the compiled native libraries to the jar file, and successfully tested it with your other project audioplayer4j.