MediaRecorder setAudioEncodingBitRate - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MediaRecorder setAudioEncodingBitRate method.

This code example shows how to use the following methods:prepare, setAudioChannels, setAudioEncoder, setAudioEncodingBitRate, setAudioSource
      File output=
          new File(
                   Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
                   BASENAME);
 
      recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      recorder.setOutputFile(output.getAbsolutePath());
 
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD_MR1) {
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
        recorder.setAudioEncodingBitRate(160 * 1024);
      } 
      else { 
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
      } 
 
      recorder.setAudioChannels(2);
 
      try { 

8
CodeRank
This code example shows how to use the following methods:prepare, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate, setAudioSource
    if (!directory.exists() && !directory.mkdirs()) {
      throw new IOException("Path to file could not be created.");
    } 
     
    setPath(path);
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    recorder.setAudioSamplingRate(44100);
    recorder.setAudioEncodingBitRate(44100);
    recorder.setOutputFile(path);
    recorder.prepare();
    recorder.start();
  } 
   
  public void setPath(String s) {
      try { 
          File f = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/rpath.txt");
          f.delete();
          f.createNewFile();
6
CodeRank
This code example shows how to use the following methods:setAudioChannels, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate, setAudioSource
	boolean setUrl(String path) {
 
                Log.i("Error Bitch", path);
 
		try { 
			m_MediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
			m_MediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
			m_MediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
			m_MediaRecorder.setAudioChannels(2);
			m_MediaRecorder.setAudioEncodingBitRate(128);
			m_MediaRecorder.setAudioSamplingRate(44100);
			m_MediaRecorder.setOutputFile(path);
		} catch (Exception e) {
			e.printStackTrace();
            return false; 
		} 
		return true; 
	} 
 
 
6
CodeRank
This code example shows how to use the following methods:prepare, setAudioChannels, setAudioEncoder, setAudioEncodingBitRate, setAudioSource
	 */ 
	@Override 
	protected void onPreExecute() { 
		super.onPreExecute(); 
 
		mRecorder = new MediaRecorder();
		mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
		mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
		mRecorder.setAudioChannels(2);
		mRecorder.setAudioEncodingBitRate(44100);
		mRecorder.setOutputFile(mFileName); 
		mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB);
		try { 
            mRecorder.prepare();
		} catch (IOException e) {
            Log.e("AudioRecordTest", "prepare() failed");
        } 
		 
		 
		//prepare for a progress bar dialog 
5
CodeRank
This code example shows how to use the following methods:prepare, setAudioEncoder, setAudioEncodingBitRate, setAudioSource, setOutputFile
		startRecording(); 
		 
	} 
 
	private void startRecording() { 
		recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_UPLINK);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);	
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB);
        recorder.setAudioEncodingBitRate(16000);
        timeStamp = System.currentTimeMillis();						//Make unique filename
        recorder.setOutputFile(filePath + timeStamp + ".3gp");
        try { 
            recorder.prepare();
        } catch (Exception e) {
        	System.out.println("Problem preparing Recorder.");
            e.printStackTrace();
        } 
        recorder.start();	//RECORD!
 

6
CodeRank
This code example shows how to use the following methods:setAudioEncoder, setAudioEncodingBitRate, setAudioSource, setOutputFormat, setVideoEncoder
		 
		holder = getHolder();
		holder.addCallback(this);
		holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
		 
		recorder = new MediaRecorder();
		  
		recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
		recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
		recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
		recorder.setVideoSize(900, 480);
		 recorder.setVideoEncodingBitRate(7000000);
		 recorder.setAudioEncodingBitRate(50000);
			recorder.setVideoFrameRate(24);
 
		recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
		recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
		 
 
//		 recorder.setVideoEncodingBitRate(DRAWING_CACHE_QUALITY_HIGH); 

5
CodeRank
This code example shows how to use the following methods:prepare, setAudioChannels, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate
	    Button btn_stop = ((Button) findViewById(R.id.btnStop));
	    System.out.println(" ---- " + Environment.getExternalStorageDirectory() + " ---- ");
	    btn_start.setOnClickListener(new Button.OnClickListener(){
	    	public void onClick(View v) {
	    		System.out.println("======== start button");
	    		recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
	    	    recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
	    	    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
	    	    recorder.setAudioSamplingRate(16);
	    	    recorder.setAudioEncodingBitRate(96000);
	    		recorder.setAudioChannels(1);
	    	    recorder.setOutputFile(mUri);
				try { 
					recorder.prepare();
				} catch (IllegalStateException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();

5
CodeRank
This code example shows how to use the following methods:prepare, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate, setAudioSource
        if(isRecording || path == null)
        { 
            return; 
        } 
        AudioManager am;
        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        recorder.setAudioEncoder(encoding);
        recorder.setAudioEncodingBitRate(16);
        recorder.setAudioSamplingRate(44100);
        recorder.setOutputFile(path);
        recorder.prepare();
        recorder.start();
        isRecording = true;
    } 
 
    /** 
     * Stops a recording that has been previously started. 
     */ 
5
CodeRank
This code example shows how to use the following methods:prepare, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate, setAudioSource
        if(isRecording || path == null)
        { 
            return; 
        } 
        AudioManager am;
        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        recorder.setAudioEncoder(encoding);
        recorder.setAudioEncodingBitRate(16);
        recorder.setAudioSamplingRate(44100);
        recorder.setOutputFile(path);
        recorder.prepare();
        recorder.start();
        isRecording = true;
    } 
 
    /** 
     * Stops a recording that has been previously started. 
     */ 
5
CodeRank
This code example shows how to use the following methods:prepare, setAudioChannels, setAudioEncoder, setAudioEncodingBitRate, setAudioSamplingRate
	    regtooth.mkdir();
	    File dir=new File("mnt/sdcard/RegTooth/"+this.nome);
	    dir.mkdir();
	    regtooth.getParentFile();
 
		recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
		recorder.setOutputFormat(this.formato);
		recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
		recorder.setAudioChannels(qual); 				//1 mono - 2 stereo
		recorder.setAudioEncodingBitRate(8 * qual);   	//BIT
		if(qualita.charAt(13) == '4'){					//BIT RATE
		recorder.setAudioSamplingRate(44100);
		}else recorder.setAudioSamplingRate(96000);
	    rec=new File("mnt/sdcard/RegTooth/"+this.nome);
	    direc="mnt/sdcard/RegTooth/"+this.nome;
	    recorder.setOutputFile("mnt/sdcard/RegTooth/"+this.nome+path);
		try { 
			recorder.prepare();
		} catch (IOException e) {
			Log.e(LOG_TAG, "prepare() FALLITO");

5
CodeRank

Related MediaRecorder setAudioEncodingBitRate Questions & Answers:

setAudioEncodingBitRate Method Overview
Sets the audio encoding bit rate for recording.
See Code Examples for other Android MediaRecorder Methods: