audio - Android AudioRecord and AudioTrack codec options? -


that I currently use audiotrack and Odiorekord classes in Android in.

I use pure PCM data but I was wondering what my options are for other codecs?

It seems that I can only encode and decode using AMR compressed?

I would like to present audio sections set this type in:

  Assisi = new Odioikrord (Meediarekorder. Awdio Sors. MIC, 11025, Odioformat .CHANNEL_CONFIGURATION_MONO, Odioformet.ansiodiaidiaipiaidiaibi 66, BOF); Atrak = new audiotrack (Audio Manager. STREAM_VOICE_CALL, 11025, Odioformet .CHANNEL_CONFIGURATION_MONO, Odioformet.ansiodiaidiaidiaidiaibi 66, Bifrs, audiotrack. MODE_STREAM);  

So my question is how do I change the encoding from PCM to another supported codex?

When I try to change the ENCODING_PCM_16BIT on the audio format, then I only have default or invalid encoding options with PCM options.

For any tutorial on audio encoding and decoding audio, any link would be great if anyone appreciated this with any or any help here.

Thanks

Edit: I changed my code to:

  arec = new audio record (Meediarekorder. Awdio Sors.amaisi, 11025, Odioformet. CHANNEL_CONFIGURATION_MONO, ** Meediarekorder. audio Ancoder.amar_anbi **, Bfrsijh); Atrak = new audiotrack (Audio Manager. STREAM_VOICE_CALL, 11025, Odioformat. CHANNEL_CONFIGURATION_MONO, ** MediaRecorder.AudioEncoder.AMR_NB **, buffer, audiotrack. MODE_STREAM);   

The code runs correctly but I am thinking that if it encodes audio as AMR_NB and if it is not the proper way to do it?

I was getting a buffer overflow while using raw PCM but no one has appeared after using the new code with MediaCracker. AudioEncoder.AMR_NB has used instead of audioformat. PCM

Audio Recorder and audiotrack : < / P>

  Audio data is represented in the form of documentation for the format of audio. See Encoding- PCM_16 BIT and Encoding_PCM_8 BIT You can work only with 8-bit and 16-bit PCM if you want audio in other formats, either  AudioRecord  and  AudioTrack  Do not use (try  MediaRecorder  and  MediaPlayer ), or you need to transcode it using your own code, potentially taking advantage of NDK. 

Audio record and audiotrack is designed for cases where audio queries are not supported by Opencore Multimedia Engine, either because it supports the supported codec Is not or is not a supported streaming protocol (for example, SIP).


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -