android-audiorecord

Android Audio Record to wav

微笑、不失礼 提交于 2021-02-11 08:32:06
问题 I recorded an audio using the audio recorder on Android and it produces a raw PCM file. I'm trying to convert it to a format I can listen to (wav or mp3 for example. I've started with this example but don't know where to go from here: Android AudioRecord example tried following these: http://computermusicblog.com/blog/2008/08/29/reading-and-writing-wav-files-in-java Recording .Wav with Android AudioRecorder Here is my code to record (note I am using Countdown Timer to tell it when to start

AudioRecord while also playing audio - accessing output playback data

放肆的年华 提交于 2021-01-29 08:08:23
问题 I'm messing around in my app with a custom model for speech commands - I have it working fine recording and processing input audio from an AudioRecord, and I give feedback to the user through text to speech. One issue I have is that I'd like this to work even when audio is playing - either through my own text to speech or through something else playing in the background (music for instance). I realize this is going to be a non trivial problem, but if I could get access in some way to the

Mixing two16-bit encoded stereo PCM samples causing noise and distortion in the resulting audio

别等时光非礼了梦想. 提交于 2021-01-27 21:35:59
问题 I get two different audio samples from two sources. For microphone sound: audioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, (AudioRecord.getMinBufferSize(44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT)*5)); For Internal sound: audioRecord = new AudioRecord.Builder() .setAudioPlaybackCaptureConfig(config) .setAudioFormat(new AudioFormat.Builder() .setEncoding(AudioFormat.ENCODING_PCM

How to record microphone to more compressed format during WebRTC call on Android?

最后都变了- 提交于 2020-04-23 05:22:50
问题 I have an app calling using WebRTC . But during a call, I need to record microphone. WebRTC has an object WebRTCAudioRecord to record audio but the audio file is so large ( PCM_16bit ). I want to record but to a smaller size. I've tried MediaRecorder but it doesn't work because WebRTC is recorded and MediaRecorder does not have permission to record while calling. Has anyone done this, or have any idea that could help me? 回答1: Webrtc is considered as comparatively much better pre-processing

Android AudioRecord Headphones with MIC

混江龙づ霸主 提交于 2020-03-03 09:09:32
问题 I am having some issues with the AudioRecord class. I have an app that records audio while someone is listening to audio through headphones. In this scenario, it works fine. Users are able to record without an issue. Any user using headphones with a built-in mic are not able to record at all. My class creates the .wav file from PCM data but no audio is being input from the mic. Its all silence. I use the following the init my AudioRecorder: extAudioRecorder = new ExtAudioRecorder(true,

Android AudioRecord Headphones with MIC

大城市里の小女人 提交于 2020-03-03 09:09:24
问题 I am having some issues with the AudioRecord class. I have an app that records audio while someone is listening to audio through headphones. In this scenario, it works fine. Users are able to record without an issue. Any user using headphones with a built-in mic are not able to record at all. My class creates the .wav file from PCM data but no audio is being input from the mic. Its all silence. I use the following the init my AudioRecorder: extAudioRecorder = new ExtAudioRecorder(true,

AudioRecord: buffer overflow?

て烟熏妆下的殇ゞ 提交于 2020-01-30 19:14:49
问题 I'm getting buffer overflow while RECORDING with my app. The recording is performed in a Service . I could not figure out why I'm getting this message from AudioFlinger . Below I instantiate the AudioRecord object and set it's callbacks. bufferSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat); aRecorder = new AudioRecord(audioSource, sampleRate, channelConfig, audioFormat, bufferSize); aRecorder.setRecordPositionUpdateListener(updateListener); bytesPerSample =

Android AudioRecord to File then use AudioTrack for Playback

倖福魔咒の 提交于 2020-01-30 02:38:52
问题 Basically, I use AudioRecord to record a sound file to sdcard directory. It records for 5 seconds and then playback using AudioTrack. Well, for me, the recorded file doesn't exist. Maybe it didn't record successfully. Anything I did wrong in recording? what about the playback portion? public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); int minBufferSize = AudioTrack.getMinBufferSize(44100, AudioFormat.CHANNEL_CONFIGURATION_MONO,