playing a MP3 file android NDK using openSL from memory - android

I have my android app where data is packed using FileWrap. The thing is I want to wrap the mp3 data into the android file and play from that memory. I have checked the nativeaudio example in NDK which shows how to play MP3 as an asset or as a filesystem file, but it does not show how I can play an MP3 that is embedded into memory.
Please help. Thanks.

I don't think that is possible... yet.
AFAIK android opensl only supports MP3 decode & playback from a stream...
I have not seen the latest ndk release (r9b) yet, but if the opensl example app does not support in-memory, on-the-fly decoding, I doubt it is available.
Perhaps having a look here may clear things up:
https://groups.google.com/forum/#!searchin/android-ndk/opensl|sort:date/android-ndk/cMHlkyQkFU0/vMkyO2201yYJ
Or you could just dump your MP3 files in the "assets" folder and play them using the AAssetManager as per usual.

Related

How can i convert 3gp file to mp3 without any library android

I have a recording Android app in which i want to convert the 3gp audio clips to mp3 in order to send them to server. As i have searched the internet, the only way to do that is through some various libraries like
Lame, FFmpeg and others which have some restrictions on my app.
For example the implementation 'com.arthenica:mobile-ffmpeg-full:4.4' which is the ffmpeg has minimumSdk to 24 but mine if for devices the support Android 5.
Is there a snippet of code that can do my job or at lease some kind of useful advice?
Thank you

How to make videos download and play inside unity app?

Hello so I am trying to make online videos download on the android export app from unity and then play it back in the same app. so far I have used a plugin EasyMovieTexure asset for streaming online videos but cannot find a way to download videos and play them. I have searched and found that I can download the video with Android Application.persistentDataPath but I don't know how to use it and save the video file to a location on android.
Help is much appreciated.
the easiest way will be using System.IO.File.WriteAllBytes () to save all byte data from the WWW object. But this method actually need RAM to hold the whole file for a while. It doesn't work if the file is too big. if the file size is too big, you probably need another way to do the downloading and saving

Can we use .wma sound files in andengine?

I am trying to use one sound file with wma extension. But when I try to play it, it doesn't play. Do andengine support .wma extension files?
Sound sound = SoundFactory.createSoundFromAsset(activity.getSoundManager(), activity, "mfx/sound111.wma");
sound.play();
But it doesn't play.
Finally got the answer. I will have to use mp3 or ogg rather than wav format. Because wma is a closed format and it's support depend on some libraries not always available on Android devices, and they're not part of the AOSP (Android Open Source Project) tree itself.

Making file world-readable in Unity android

I am making an app in Unity for android which plays a whole bunch of videos.
Since the apk would be too big if all videos were added at build time, I download the videos at runtime and store them using: Application.persistentDataPath + "/"+filename+".mp4";
The problem is that I am playing the videos inside unity but some devices do not support this functionality (API too low or GPU doesn't support a specific openGL extension), so in those cases my fallback solution is to use androids native player by calling: Handheld.PlayFullScreenMovie(path)
Unfortunately, the videos are stored without world-readable access and therefore the native player is not able to play the downloaded videos.
So my question is, is there a way to make these file world-readable using the path currently used? If not, is there a reliable location where I can store these files where the native player will have access to them regardless of android device?

Streaming .m3u file in Android 3.0

I am looking to develop an application where I have to stream .m3u file, this is for ANDROID 3.0 only.
I want to stream this link
dl.dropbox.com/u/2377944/test/abr_test/index.m3u8
it must work in emulator too
I searched a lot, but nothing seems to be working too good.
Please help.
Thanks in advance.
m3u is a play list format, a text file, and not actually audio/video media itself. That means it references media that you would want to stream. The distinction is important.
The contents of the m3u file is important. (Your link is dead, btw.) Show that to use and we can help more. Each of the media files contained in the m3u must be valid and point to media that is compatible with Android.
What makes the media compatable? Check the Android Supported Media Formats page.

Categories

Resources