本文整理了Java中android.media.MediaRecorder.setAudioChannels()
方法的一些代码示例,展示了MediaRecorder.setAudioChannels()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MediaRecorder.setAudioChannels()
方法的具体详情如下:
包路径:android.media.MediaRecorder
类名称:MediaRecorder
方法名:setAudioChannels
暂无
代码示例来源:origin: commonsguy/cw-omnibus
recorder.setOutputFile(getStreamFd());
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioChannels(2);
代码示例来源:origin: commonsguy/cw-omnibus
recorder.setAudioChannels(2);
代码示例来源:origin: robolectric/robolectric
@Test
public void testAudioChannels() throws Exception {
assertThat(shadowMediaRecorder.getAudioChannels()).isNotEqualTo(2);
mediaRecorder.setAudioChannels(2);
assertThat(shadowMediaRecorder.getAudioChannels()).isEqualTo(2);
}
代码示例来源:origin: florent37/CameraFragment
videoRecorder.setAudioChannels(camcorderProfile.audioChannels);
videoRecorder.setAudioSamplingRate(camcorderProfile.audioSampleRate);
videoRecorder.setAudioEncoder(camcorderProfile.audioCodec);
代码示例来源:origin: florent37/CameraFragment
videoRecorder.setAudioChannels(camcorderProfile.audioChannels);
videoRecorder.setAudioSamplingRate(camcorderProfile.audioSampleRate);
videoRecorder.setAudioEncoder(camcorderProfile.audioCodec);
代码示例来源:origin: ankidroid/Anki-Android
mRecorder.setAudioChannels(2);
mRecorder.setAudioSamplingRate(44100);
mRecorder.setAudioEncodingBitRate(192000);
代码示例来源:origin: dkim0419/SoundRecorder
public void startRecording() {
setFileNameAndPath();
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setOutputFile(mFilePath);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mRecorder.setAudioChannels(1);
if (MySharedPreferences.getPrefHighQuality(this)) {
mRecorder.setAudioSamplingRate(44100);
mRecorder.setAudioEncodingBitRate(192000);
}
try {
mRecorder.prepare();
mRecorder.start();
mStartingTimeMillis = System.currentTimeMillis();
//startTimer();
//startForeground(1, createNotification());
} catch (IOException e) {
Log.e(LOG_TAG, "prepare() failed");
}
}
代码示例来源:origin: guoxiaoxing/phoenix
mMediaRecorder.setAudioChannels(mCamcorderProfile.audioChannels);
mMediaRecorder.setAudioSamplingRate(mCamcorderProfile.audioSampleRate);
mMediaRecorder.setAudioEncoder(mCamcorderProfile.audioCodec);
代码示例来源:origin: guoxiaoxing/phoenix
mMediaRecorder.setAudioChannels(mCamcorderProfile.audioChannels);
mMediaRecorder.setAudioSamplingRate(mCamcorderProfile.audioSampleRate);
mMediaRecorder.setAudioEncoder(mCamcorderProfile.audioCodec);
代码示例来源:origin: easemob/kefu-android-demo
mMediaRecorder.setAudioChannels(1); // MONO
mMediaRecorder.setAudioSamplingRate(8000); // 8000Hz
mMediaRecorder.setAudioEncodingBitRate(64);
代码示例来源:origin: huangfangyi/YiChat
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioChannels(1); // MONO
recorder.setAudioSamplingRate(8000); // 8000Hz
recorder.setAudioEncodingBitRate(64); // seems if change this to
代码示例来源:origin: AppLozic/Applozic-Android-SDK
public MediaRecorder prepareMediaRecorder() {
audioRecorder = new MediaRecorder();
audioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
audioRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
audioRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
audioRecorder.setAudioEncodingBitRate(256);
audioRecorder.setAudioChannels(1);
audioRecorder.setAudioSamplingRate(44100);
audioRecorder.setOutputFile(outputFile);
return audioRecorder;
}
}
代码示例来源:origin: YiChat/android_YiChat_Lite
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioChannels(1); // MONO
recorder.setAudioSamplingRate(8000); // 8000Hz
recorder.setAudioEncodingBitRate(64); // seems if change this to
代码示例来源:origin: HelloChenJinJun/TestChat
mMediaRecorder.setAudioChannels(1);
代码示例来源:origin: huangfangyi/FanXin
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioChannels(1); // MONO
recorder.setAudioSamplingRate(8000); // 8000Hz
recorder.setAudioEncodingBitRate(64); // seems if change this to
代码示例来源:origin: AppLozic/Applozic-Android-SDK
public MediaRecorder prepareMediaRecorder() {
audioRecorder = new MediaRecorder();
audioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
audioRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
audioRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
audioRecorder.setAudioEncodingBitRate(256);
audioRecorder.setAudioChannels(1);
audioRecorder.setAudioSamplingRate(44100);
audioRecorder.setOutputFile(outputFile);
audioRecorder.setOnInfoListener(this);
audioRecorder.setOnErrorListener(this);
return audioRecorder;
}
代码示例来源:origin: wobiancao/RtspServerAndVlcPlay
mMediaRecorder.setOutputFormat(mOutputFormat);
mMediaRecorder.setAudioEncoder(mAudioEncoder);
mMediaRecorder.setAudioChannels(1);
mMediaRecorder.setAudioSamplingRate(mQuality.samplingRate);
mMediaRecorder.setAudioEncodingBitRate(mQuality.bitRate);
代码示例来源:origin: QuickBlox/ChatMessagesAdapter-android
private void initMediaRecorder() {
recorder = new MediaRecorder();
recorder.setAudioSource(configurationBuilder.audioSource);
recorder.setOutputFormat(configurationBuilder.outputFormat);
recorder.setOutputFile(configurationBuilder.filePath);
recorder.setAudioChannels(configurationBuilder.channels);
recorder.setAudioEncoder(configurationBuilder.audioEncoder);
recorder.setAudioEncodingBitRate(configurationBuilder.bitRate);
recorder.setAudioSamplingRate(configurationBuilder.samplingRate);
recorder.setMaxDuration(configurationBuilder.duration);
recorder.setOnInfoListener(new OnInfoListenerImpl());
recorder.setOnErrorListener(new OnErrorListenerImpl());
}
代码示例来源:origin: hypeapps/Endoscope
mMediaRecorder.setOutputFormat(mOutputFormat);
mMediaRecorder.setAudioEncoder(mAudioEncoder);
mMediaRecorder.setAudioChannels(1);
mMediaRecorder.setAudioSamplingRate(mQuality.samplingRate);
mMediaRecorder.setAudioEncodingBitRate(mQuality.bitRate);
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
mMediaRecorder.setOutputFormat(mOutputFormat);
mMediaRecorder.setAudioEncoder(mAudioEncoder);
mMediaRecorder.setAudioChannels(1);
mMediaRecorder.setAudioSamplingRate(mQuality.samplingRate);
mMediaRecorder.setAudioEncodingBitRate(mQuality.bitRate);
内容来源于网络,如有侵权,请联系作者删除!