Best code examples for Android AudioRecord class (android.media.AudioRecord)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AudioRecord class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android AudioRecord examples from Open Source projects
This code example shows how to use the following methods: release, stop
129:	iTrack.stop(); 
-
146:	iTrack.release(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getAudioFormat, getChannelCount, getSampleRate, release
190:	if( mRecorder == null || mRecorder.getSampleRate() != rate || 
191:	mRecorder.getChannelCount() != channels || 
192:	mRecorder.getAudioFormat() != encodingConfig || 
-
196:	mRecorder.release(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getState, startRecording
30:	AudioRecord recorder = new AudioRecord(audioSource, 
-
33:	if (recorder.getState() != AudioRecord.STATE_INITIALIZED) { 
-
38:	recorder.startRecording(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
150:	audioRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, mBufferSize); 
151:	if (audioRecorder.getState() != AudioRecord.STATE_INITIALIZED) { 
-
154:	audioRecorder.setRecordPositionUpdateListener(updateListener); 
155:	audioRecorder.setPositionNotificationPeriod(mPeriodInFrames); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getRecordingState, getState, startRecording
109:	if (_mic != null && _mic.getState() == AudioRecord.STATE_INITIALIZED) { 
-
113:	_mic.startRecording(); 
-
119:	+ _mic.getState() + ", recordingState=" 
120:	+ _mic.getRecordingState()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getRecordingState, release, stop
182:	if (audioRecord.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING) { 
183:	audioRecord.stop(); 
-
185:	audioRecord.release(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getRecordingState, getState, read, startRecording, stop
231:	AudioRecord recorder = new AudioRecord(AudioSource.MIC, 8000, AudioFormat.CHANNEL_IN_MONO, 
-
234:	if (recorder.getRecordingState() == android.media.AudioRecord.RECORDSTATE_STOPPED) 
235:	recorder.startRecording(); // check to see if the Recorder 
-
240:	recorder.read(audioData, 0, bufferSize); // read the PCM 
-
246:	if (recorder.getState() == android.media.AudioRecord.RECORDSTATE_RECORDING) 
247:	recorder.stop(); // stop the recorder 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAudioFormat, getChannelCount, getSampleRate, release
186:	if( mRecorder == null || mRecorder.getSampleRate() != rate || 
187:	mRecorder.getChannelCount() != channels || 
188:	mRecorder.getAudioFormat() != encodingConfig || 
-
192:	mRecorder.release(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: startRecording
37:	: AudioFormat.CHANNEL_CONFIGURATION_STEREO, AudioFormat.ENCODING_PCM_16BIT, minBufferSize); 
38:	recorder.startRecording(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, release, startRecording, stop
17:	AudioRecord record = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 44100, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, (minBuffer * 100)); 
-
19:	record.startRecording(); 
-
21:	nbPoint = record.read(point, 0, point.length); 
-
23:	record.stop(); 
24:	record.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: read, release, startRecording, stop
22:	AudioRecord record = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 
-
27:	record.startRecording(); 
-
29:	nbPoint = record.read(point, 0, point.length); 
-
31:	record.stop(); 
32:	record.release(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getState, setNotificationMarkerPosition, setPositionNotificationPeriod, setRecordPositionUpdateListener
76:	sampleRate, channelConfig, audioFormat, mAudioBufferSize); 
-
84:	mAudioRecord.setNotificationMarkerPosition(10000); 
85:	mAudioRecord.setPositionNotificationPeriod(1000); 
86:	mAudioRecord.setRecordPositionUpdateListener(mListener); 
-
88:	int audioRecordState = mAudioRecord.getState(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
179:	aRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, bufferSize); 
180:	if (aRecorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
182:	aRecorder.setRecordPositionUpdateListener(updateListener); 
183:	aRecorder.setPositionNotificationPeriod(framePeriod); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getState, setNotificationMarkerPosition, setPositionNotificationPeriod, setRecordPositionUpdateListener
81:	mAudioBufferSize); 
-
88:	mAudioRecord.setNotificationMarkerPosition(10000); 
89:	mAudioRecord.setPositionNotificationPeriod(1000); 
90:	mAudioRecord.setRecordPositionUpdateListener(mListener); 
-
92:	int audioRecordState = mAudioRecord.getState(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getState, setNotificationMarkerPosition, setPositionNotificationPeriod, setRecordPositionUpdateListener
81:	mAudioBufferSize); 
-
88:	mAudioRecord.setNotificationMarkerPosition(10000); 
89:	mAudioRecord.setPositionNotificationPeriod(1000); 
90:	mAudioRecord.setRecordPositionUpdateListener(mListener); 
-
92:	int audioRecordState = mAudioRecord.getState(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, setPositionNotificationPeriod, setRecordPositionUpdateListener, startRecording
155:	minbufferSize); 
-
157:	audioRecord.setPositionNotificationPeriod(bufferSize); 
158:	audioRecord.setRecordPositionUpdateListener(new OnRecordPositionUpdateListener() { 
-
175:	audioRecord.startRecording(); 
-
179:	audioRecord.read(buffer, 0, bufferSize); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, release, startRecording, stop
70:	recorder.startRecording(); 
71:	recorder.read(readData, 0, readData.length); 
72:	recorder.stop(); 
73:	recorder.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: read, setPositionNotificationPeriod, setRecordPositionUpdateListener, startRecording
111:	sampleRate, nChannelConfig, audioConfig, bufferSize); 
-
128:	recordInstance.setRecordPositionUpdateListener(updateListener); 
129:	recordInstance.setPositionNotificationPeriod(framePeriod); 
130:	recordInstance.startRecording(); 
131:	recordInstance.read(dataBuffer, 0, dataBuffer.length); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, setPositionNotificationPeriod, setRecordPositionUpdateListener, startRecording
111:	sampleRate, nChannelConfig, audioConfig, bufferSize); 
-
128:	recordInstance.setRecordPositionUpdateListener(updateListener); 
129:	recordInstance.setPositionNotificationPeriod(framePeriod); 
130:	recordInstance.startRecording(); 
131:	recordInstance.read(dataBuffer, 0, dataBuffer.length); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, startRecording, stop
95:	audioRecord.startRecording(); 
96:	mSamplesRead = audioRecord.read(buffer, 0, buffersizebytes); 
97:	audioRecord.stop(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
199:	channelConfig, audioFormat, bufferSize); 
-
201:	if (audioRecorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
203:	audioRecorder.setRecordPositionUpdateListener(updateListener); 
204:	audioRecorder.setPositionNotificationPeriod(framePeriod); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: startRecording
284:	final AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, 
-
289:	audioRecord.startRecording(); 
-
295:	new Thread(new Runnable() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: read, startRecording, stop
95:	audioRecord.startRecording(); 
96:	mSamplesRead = audioRecord.read(buffer, 0, buffersizebytes); 
97:	audioRecord.stop(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: read, startRecording, stop
142:	AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, AudioFormat.CHANNEL_IN_MONO, audioEncoding, recBufferSize); 
-
144:	audioRecord.startRecording(); 
145:	audioRecord.read(recData, 0, recBufferSize); 
146:	audioRecord.stop(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: release, stop
40:	androidRecorder.stop(); 
41:	androidRecorder.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
177:	aRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, bufferSize); 
178:	if (aRecorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
180:	aRecorder.setRecordPositionUpdateListener(updateListener); 
181:	aRecorder.setPositionNotificationPeriod(framePeriod); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
245:	aRecorder = new AudioRecord(aSource, sRate, cConfig, aFormat, bufferSize); 
246:	aRecorder.setRecordPositionUpdateListener(updateListener); 
247:	aRecorder.setPositionNotificationPeriod(framePeriod); 
-
253:	if (aRecorder.getState() == AudioRecord.STATE_INITIALIZED) 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
177:	aRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, bufferSize); 
178:	if (aRecorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
180:	aRecorder.setRecordPositionUpdateListener(updateListener); 
181:	aRecorder.setPositionNotificationPeriod(framePeriod); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: release, stop
147:	recorder.stop(); 
148:	recorder.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, startRecording
36:	minBufferSize); 
37:	if (recorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
39:	recorder.startRecording(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAudioFormat, getChannelConfiguration, getSampleRate
21:	if (audioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT){ 
-
24:	else if (audioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_8BIT){ 
-
30:	if (audioRecord.getChannelConfiguration() == AudioFormat.CHANNEL_CONFIGURATION_MONO){ 
-
38:	waveHeader.setSampleRate(audioRecord.getSampleRate()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: release, stop
38:	ar.stop(); 
39:	ar.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setPositionNotificationPeriod, setRecordPositionUpdateListener
28:	recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, SAMPLING_RATE,CHANNEL,ENCODING, N * 10); 
29:	recorder.setPositionNotificationPeriod(256); 
30:	recorder.setRecordPositionUpdateListener(mRecordListener); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
182:	mRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, mBufferSize); 
183:	if (mRecorder.getState() != AudioRecord.STATE_INITIALIZED) { 
-
186:	mRecorder.setRecordPositionUpdateListener(mListener); 
187:	mRecorder.setPositionNotificationPeriod(mFramePeriod); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAudioFormat, getChannelConfiguration, getSampleRate
29:	if (audioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) { 
-
31:	} else if (audioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_8BIT) { 
-
37:	if (audioRecord.getChannelConfiguration() == AudioFormat.CHANNEL_CONFIGURATION_MONO) { 
-
45:	waveHeader.setSampleRate(audioRecord.getSampleRate()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, release, stop
83:	&& audioRecord.getState() == AudioRecord.STATE_INITIALIZED) { 
84:	audioRecord.stop(); 
85:	audioRecord.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getState, setPositionNotificationPeriod, setRecordPositionUpdateListener
191:	audioRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, bufferSize); 
-
193:	if (audioRecorder.getState() != AudioRecord.STATE_INITIALIZED) 
-
195:	audioRecorder.setRecordPositionUpdateListener(updateListener); 
196:	audioRecorder.setPositionNotificationPeriod(framePeriod); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: release, stop
40:	recorder.stop(); 
41:	recorder.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: release, stop
81:	mAudioRecord.stop(); 
82:	mAudioRecord.release(); 
Full Snippet Info
5
CodeRank
Related Android AudioRecord Questions & Answers:
See Code Examples for Android AudioRecord Methods: