Skip to content
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

Unable to load audio files in jar file #2

Open
fgnm opened this issue May 22, 2022 · 3 comments
Open

Unable to load audio files in jar file #2

fgnm opened this issue May 22, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@fgnm
Copy link
Member

fgnm commented May 22, 2022

Currently, gdx-miniaudio cannot read audio files placed inside the .jar archive. There are a couple way to fix this on the library side, but any fix looks out of the scope of this library. At moment the most efficient way to load audio files packed in a distribution jar is to extract them to a temporary directory and load files with absolute/relative path.

@fgnm fgnm added the help wanted Extra attention is needed label May 22, 2022
@Geolykt
Copy link

Geolykt commented Nov 15, 2023

Why isn't the usage of decoders a possibility? It would allow the usage of ma_decoder_init_memory, which would ultimately mean that the PCM data from FLACs, MP3s or WAVs could easily be gathered without depending on other libraries. Of course, doing so probably would mean creating an MADecoder class.

From the rough MA calls needed you'd probably have something similar to (of course grossly over-exaggerated)

ma_decoder decoder;
ma_decoder_init_memory(data, length, NULL /* (The decoder config) */, &decoder);
ma_result result = ma_decoder_read_pcm_frames(&decoder, framesOut, frameCount, &framesOutCount);
ma_decoder_uninit(&decoder);

@fgnm
Copy link
Member Author

fgnm commented Nov 15, 2023

Yes you're right, a MADecoder binding would be useful in this and also other cases.. I'm also sorry that the binding is stuck at v0.11.17 while MiniAudio is now at v0.11.21, unfortunately I lost my way to test macOS and iOS.. But I know, I need to keep this updated in a way or another, I'll try to find a solution soon :)

@Geolykt
Copy link

Geolykt commented Nov 15, 2023

I unfortunately cannot help on that front

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants