Android Audio [SOLVED]

Hey folks. This is my first question on the forum. Part of the fun of programming for me is figuring this stuff out. But, try as I may, I cannot get the audio to work on Android at all. I’ve tried everything I could think of and run every piece of code I could find–no joy! I’ve had no problems figuring out the graphics, but with the lack of documentation and examples for Android audio, I’m lost. Plus, half the links are dead in the forum, audio was broken between builds xxx and xxx, etc., etc.

I’m reaching out for help (while I still have hair left I haven’t pulled out yet)! I am using Gradle, Android Studio, and compiling in both 3.3.2 (stable) and 3.4.0 (alpha1). A simple 3.3.2 example would be much appreciated.

There is a very simple example that comes with the engine called Could someone please show me how to get the same results with Android? This should be enough to get me started in the audio, then the JavaDocs should work for me from there. If I missed a simple example somewhere, forgive me, but as I’ve been trying to figure this out for 3 days, I don’t think I’ve left many stones un-turned!

Thanks in advance.

Hi @Trasd

Probably it’s related to this issue

It is fixed in JME v3.4.0-alpha3.

Can you please try with the latest release? (3.4.0-alpha4)


@Ali_RS That’s the point. I’m new to game programming and jMonkey and, I don’t even know what the proper use is! With all the different (and lack) of information, I haven’t the slightest idea of how to even use audio in Android.

1 Like

I would suggest starting from the wiki

Afaik playing audio on android should be the same as playing audio on desktop.

Have you read the wiki?

Also can you show us your code?

I’ve tried all the code I could lay my hands on, especially from the official docs, but it seems I was wasting my time! I didn’t realize it was broken. I saw from a couple years ago there were problems, but I figured they would have been fixed by now. My bad.

Long story, but I’m stuck with 3.3.2 or the first 3.4 alpha for now. I’ll have to try a direct lwjgl work-around or abandon my current toolchain for another engine. I’d rather not as I’ve invested in some books, but sometimes, c’est la vie!


Did something else break with 3.4 alpha4?

1 Like

Hmm, not that I know of. My games still work going from 3.3.2 to 3.4.0-alpah4 without anything breaking, but I also have not tested any android apps.

@tlf30 et. al.

This is purely an Android (Gradle) problem (hence the title! LOL - really, a joke, not trying to be a sarcastic jerk).

I’ve temporarily gotten around the problem by targeting 3.2.4-stable. I may be able to go higher, but I haven’t researched it yet (I thought Gradle builds started with 3.3.2). I may be able to build locally, too (and be able to work in 3.2.4-stable audio until it is verified as fixed - I cannot learn and verify at the same time), but again, I haven’t researched it yet. My goal was to find properly working code so I’d at least know it wasn’t my fault. Now that I have known working code, I can start experimenting and mixing and matching and such…

To make a long story short, I’m currently stuck with a Java 1.7 IDE which is a bit primitive. I know I said Android Studio in the first post, but I did that on purpose so fingers were not automatically pointed at my IDE as the culprit, which it isn’t.

The jMonkey version that I learn on isn’t as important to me right now as having everything actually work! Once I learn jMonkey, then I can move the code to my programming PC and write stuff for actual release. Now, with Android audio working, I can continue my education!

So, I thank everyone who responded. I really didn’t think I’d get so many responses so quickly. That just goes to prove I selected the right engine with a concerned community.

1 Like