Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.ogg
the %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.