Unable to play mp3 and other files on some devices

I am using a Player to play an .mp3 file. It works on my phone's Companion app but not on my computer's BlueStacks 5 emulator. I used the exact same code for both tries. Is that a problem with App Inventor or with BlueStacks?

P.S. The same also happens with .wmv files, just in reverse (can play on BlueStacks, can't play on phone).

Show your (relevant) blocks.


Enable READ permission. https://support.bluestacks.com/hc/en-us/articles/360062395071-How-to-enable-disable-app-permissions-in-BlueStacks-5

WMV files are special (outdated) Windows video formats that are not played back by DVD players or Apple's Quick Time etc.

I see. I will avoid using them in my app.

Minimal example:
image
MakeFullPathFromAsdPath is a helper function I've written to handle ASD path-to-full path translation.

I'll have a look that right now... Will reply back when done.

Connect to Companion, make a right mouse click on the MakeFullPath... block, "Do it" and post the result.

  • Where does the audio file (test.mp3) come from?
  • Which Android version?

Does not work. Player finishes immediately without producing any sound.

Somehow .mp4 files work...

Downloaded to ASD, but I can confirm that packaged assets also fail.

BlueStacks 5 Android 11

With Companion? If so, that doesn't make any sense at all. Post the aia.

Please wait a bit... Am packaging...

Minimal .aia:
TestPlayer.aia (2.0 MB)

Where is the problem? It works fine here.

On BlueStacks 5 running Android 11. The Companion App on my phone works fine.

Does it (mp3) work with Companion?

On BlueStacks, no.

Forget BlueStacks, build the APK and you will see it works.

I'm not allowed to hand in .apk files, only .aia files...

Is it a known bug or something?

You should test it with the APK on a real device!

I generally don't test with Android emulators. That always just causes problems. I always only test on real devices.

Only with my iOS apps I use the Apple Xcode Simulator, because this works perfectly.

I know... but my work is only graded using .aia files, and .apk files are not taken into consideration...

I see... But sometimes an emulator is all that we students can access...