Android Question Creating AMR audio file.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Freinds,

I am trying to record audio in AMR file since long.I am not able to find anything in forum.I came across an EXE which converts MP3, WAV file into AMR. Is it at all possible to use it in app to convert MP3 file to AMR file.

In Automatic App(Call recording App) audio files are stored in AMR format only.

Pls advice.

Thanks
Juzer
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

JohnC

Expert
Licensed User
Longtime User
If you want to record audio and have it create an AMR file, one of the audio recorder libs in this forum can do that (because I used it in a previous project) - and I believe that this is the audiorecorder lib that can do that:

https://www.b4x.com/android/forum/threads/audiorecord-library.13993/

(just examine the encoding and fileformat settings)

NOTE: if you want to create an AMR file that will play on both Android and iOS devices, then you must create a "narrow-band" (not wide band) AMR file.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can try this Library. It is a quick wrap for this Github project. It is fully untested!
Note that you need special permissions. You need to start with initialize and give the recording PATH.

in regard to @JohnC comment:
B4X:
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

Looks like it is using the right format i guess.
 

Attachments

  • AMRRecordV1.0.zip
    3.7 KB · Views: 167
Last edited:
Upvote 0

JohnC

Expert
Licensed User
Longtime User
EXE files only run on Windows PC's. They will not run on Android.

If you want to convert an already existing MP3 file to AMR, then you should use the ffmpegencoder as mentioned in post #3.
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi JohnC
I would like create AMR file directly after recording.
I am using audio streamer to create WAV file.
There is no way to change encoding and file format in above jar file as it is a library.
Juzer
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Then I would use Moster67's wrapper in post #3. It's a little bit of a learning curve, but will do exactly what you need (WAV to AMR).
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,

I used Liblame library to convert WAV to MP3. In android 4.1.2 it works fine but in ver 8.1.1 the app crashes while encoding.I am using targetSDKversion-26.
Is there any workaround or any other library.

Pls advice.

Thanks
Juzer
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Are you using Moster67's wrapper in post #3?

I have a tester of one of my apps that convert wav to wp3 on his pixel running 8.x without any issues.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Upvote 0
Top