mediarecorder - How to use different audio encoding bitrate for media recorder android -
In my application I am using the media recorder for audio recording. I use different bit rate 32,64,128,160 etc. Want to do
recorder = new MediaRecorder (); / ****** Audio source ****** / try {if (audio_source.equals ("camcorder") recorder.setAdosource (MediaRecorder.AudioSource.CAMCORDER); Otherwise if (audio_source.qual ("MIC")) recorder.SetAudio Source (Media Records. AudioSOS.MIC); Other recorders.SetAudio Source (MediaRecorder.AudioSource.DEFAULT); } Hold (exception e) {recorder.setAudioSource (MediaRecorder.AudioSource.MIC); } / ****** Audio channel ****** / try {if (audio_channel.equalsIgnoreCase ("mono")) {recorder.setAudioChannels (1); } And if (audio_channel.equalsIgnoreCase ("stereo")) {recorder.setAudioChannels (2); }} Hold (exception e) {recorder.setAudioChannels (1); } System.out.println ("bitrate -" + bit_rate); If (Build.VERSION.SDK_INT> = 10) {recorder.setAudioSamplingRate (44100); // 44100} and {recorder.setAudioSamplingRate (8000); // 44100} / ****** AudioEncodingBitRate ***** * / Try {System.out.println ("Try ..." + bit_rate); If (bit_rate.equalsIgnoreCase ("32")) {recorder.setAudioEncodingBitRate (32000); } And if (bit_rate.equalsIgnoreCase ("64")) {recorder.setAudioEncodingBitRate (64000); } And if (bit_rate.equalsIgnoreCase ("96")) {recorder.setAudioEncodingBitRate (96000); } And if (bit_rate.equalsIgnoreCase ("128")) {recorder.setAudioEncodingBitRate (128000); } And if (bit_rate.equalsIgnoreCase ("160")) {recorder.setAudioEncodingBitRate (160000); }} Hold (exception e) {recorder.setAudioEncodingBitRate (64); } / ****** file format ****** / /recorder.setOutputFormat (MediaRecorder.OutputFormat.MPEG_4); If (format.equals (".mp4")) {recorder.setOutputFormat (MediaRecorder.OutputFormat.MPEG_4); } Else {recorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); } If (build.VERSION.SDK_INT> = 10) {recorder.setAudioSamplingRate (44100); // 44100 Recorder .SetAudio Encoder (Media Records. Audio Encoder.ac); } Other {recorder.SetAudio SampleGenet (8000); // 44100 Recorder.SetAudio Encoder (Media Records. Audio Encoder.AMR_NB); } Recorder.setOutputFile (audiofile.getAbsolutePath ()); Recorder.prepare (); But I did not get any changes to quality using all the above bit rate situations. How can I use it?
According to the bitrate bits are set per second and
are ready () Can check additional parameters on the parameter to determine whether a specified bit rate is applied, and sometimes the pass bitrate will be internally clotted so that it can be ensured that depending on the capabilities of audio recording Can move forward smoothly on the stage.
I think this clipping has happened in this case, because 160 seconds per second is ridiculous.
Comments
Post a Comment