AMR codec MediaRecorder use?

221 views
Skip to first unread message

cindy

unread,
Nov 3, 2010, 6:20:19 PM11/3/10
to android-ndk
MediaRecorder creates AMR-NB audio file. What is the codec it used?
can I use the same codec and how?

Thanks!

Cindy

mic _

unread,
Nov 4, 2010, 2:14:12 AM11/4/10
to andro...@googlegroups.com
Probably depends on the vendor, but on some devices you might find an OMX component named something like libomxamrenc.so. You'll have to search elsewhere for info on how to use it though, since it's not something that's part of the NDK.

/Michael


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Russell Tillitt

unread,
Nov 4, 2010, 2:48:05 AM11/4/10
to andro...@googlegroups.com
I don't know if its still used, but in earlier versions of Android, the AmrInputStream class utilized an existing JNI wrapper, which might still be around

public final class AmrInputStream extends InputStream
{   

    static
    {
        System.loadLibrary("media_jni");
    }

...

}




rt
--
Russell Tillitt
CEO & Co-Founder
Embee Mobile, Inc
Facebook: http://apps.facebook.com/mobilewallet
Website: http://www.embeemobile.com

cindy

unread,
Nov 4, 2010, 2:38:17 PM11/4/10
to android-ndk
It is still in Android tree. But it is not in Android SDK provided by
google. Does anyone know why?

On Nov 3, 11:48 pm, Russell Tillitt <russ...@embeemobile.com> wrote:
> I don't know if its still used, but in earlier versions of Android, the
> AmrInputStream class utilized an existing JNI wrapper, which might still
> be around
>
> public final class AmrInputStream extends InputStream
> {
>
>      static
>      {
>          System.loadLibrary("media_jni");
>      }
>
> ...
>
> }
>
> rt
>
> On 11/3/2010 11:14 PM, mic _ wrote:
>
>
>
> > Probably depends on the vendor, but on some devices you might find an
> > OMX component named something like libomxamrenc.so. You'll have to
> > search elsewhere for info on how to use it though, since it's not
> > something that's part of the NDK.
>
> > /Michael
>
> > On Wed, Nov 3, 2010 at 11:20 PM, cindy <ypu01...@yahoo.com
> > <mailto:ypu01...@yahoo.com>> wrote:
>
> >     MediaRecorder creates AMR-NB audio file. What is the codec it used?
> >     can I use the same codec and how?
>
> >     Thanks!
>
> >     Cindy
>
> >     --
> >     You received this message because you are subscribed to the Google
> >     Groups "android-ndk" group.
> >     To post to this group, send email to andro...@googlegroups.com
> >     <mailto:andro...@googlegroups.com>.
> >     To unsubscribe from this group, send email to
> >     android-ndk...@googlegroups.com
> >     <mailto:android-ndk%2Bunsu...@googlegroups.com>.

mic _

unread,
Nov 5, 2010, 5:19:40 AM11/5/10
to andro...@googlegroups.com
Depending on the vendor, AMR_NB may be exposed as a valid output format for MediaRecorder. I know of applications that use this, but they're not 3rd party apps, so you could find yourself out of luck if you want your app to work on all/most devices.

/Michael

Onur Cinar

unread,
Nov 5, 2010, 1:40:07 PM11/5/10
to andro...@googlegroups.com

Hi Cindy,

Instead of accessing the AMR codec library directly, you may still use the MediaRecorder.  I'm guessing that you are planing to stream AMR?   If that is the case, take a look at the ParcelFileDescriptor, which can get MediaRecorder to stream AMR to a socket very easily, and you won't need to deal with the native libraries.

Regards,

-onur
---
www.zdo.com

HyeeWang

unread,
Nov 8, 2010, 10:03:51 PM11/8/10
to android-ndk
hi, cindy!

I also are searching the gsmamr-nb codec. Since Android can produce
amr format file,it must have amr codec function interface provided.
But where is it?

I downloaded gsmamr code and build my own gsmamr library. But it run
so slow that can not work at all. It you find the appropriate
available codec function interface, please let me know. Thank you.
Reply all
Reply to author
Forward
0 new messages