Adds `load_from_file()` to `AudioStreamMP3`
I noticed in the docs while working on my own project that AudioStreamMP3 was missing load_from_file(), which ogg already has.
This PR adds that missing function so that it matches ogg.
I wanted to add it to WAV as well, but I can do it in a later PR.
seems like I'm doing indentation wrong for the docs, what's the correct way to do it? and is there a way to test that locally so I don't spam the PR?
I think it is strange that ResourceImporterOggVorbis has load_from_buffer and load_from_file methods while ResourceImporterMP3 has only import_mp3 method which by function signature looks like load_from_file...
seems like I'm doing indentation wrong for the docs, what's the correct way to do it? and is there a way to test that locally so I don't spam the PR?
Try to install pre-commit
seems like I'm doing indentation wrong for the docs, what's the correct way to do it? and is there a way to test that locally so I don't spam the PR?
Try to install pre-commit
It usually runs before you made a commit. When you manually run it there is no unstaged/modified files so it doesn't have what to check...
ah, got it.
There in the docs which you mentioned a bit lower is placed note
But I am glad you didn't notice it, it forced godot to support runtime loading of mp3 and I hope wav (if you are still going to do the same with wav otherwise I think can do it).
This comment is also something like TODO because after merging these pr's that note in docs will become outdated
A potentially empty new line with only whitespace is making the static checks fail.
Will need to be rebased before this can be merged
Will need to be rebased before this can be merged
Done 👍
I squashed the commits and fixed remaining style issues, this should now be ready.
I think it is strange that
ResourceImporterOggVorbishasload_from_bufferandload_from_filemethods whileResourceImporterMP3has onlyimport_mp3method which by function signature looks likeload_from_file...
You're right, ResourceImporterMP3 should also have load_from_buffer and not just load_from_file. I'll fix that.
I think it is strange that
ResourceImporterOggVorbishasload_from_bufferandload_from_filemethods whileResourceImporterMP3has onlyimport_mp3method which by function signature looks likeload_from_file...You're right,
ResourceImporterMP3should also haveload_from_bufferand not justload_from_file. I'll fix that.
Superseded by #100307 which implements the missing load_from_buffer, and further harmonizes all the WAV/Ogg Vorbis/MP3 runtime loading code to follow the same structure based on #93831.
Thanks for the contribution! I added you as co-author to #100307.