AudioSource.VOICE_CALL samsung galaxy - android

I have two Samsung Galaxy S2, same provider (H3G Italy), same firmware (2.3.5) bought together in same shop.
I develop an app for call recording, using mediarecorder and using as audiosource VOICE_CALL, this work well on one device and not on second.
During the debug there is no errors in Log, just the app stuck.
The Mediarecorder.start is called on PhoneStateListener status change, I tried with all audio format available in mediarecorder but no success.
If in mediarecorder.setaudiosource I add also VOICE_UPLINK then the app do not freeze anymore, but the audio quality is too low.
How is possible that two same mobile, same code and same development PC, one work fantastic and an other not?

You will get the original .wav file by using AudioRecorder.
And then you need to encode it into other format of audio files you want.
For example this project provides a method to use lame libs to encode the .wav file to MP3.
By setting up the output sampling rate bit you can get the mp3 file with the size you want.

Related

Audio quality issue when recorded with MediaRecorder

The audio recorded by MediaRecorder in android App having so much noise.How can I use noise suppression to remove noice while recording.
I had the same problem of low audio quality while using MediaRecorder and finally figured out the correct working solution. Here are few modifications you need to do for good quality audio recordings:
save the file using .m4a extention.
and
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
mRecorder.setAudioEncodingBitRate(16*44100);
mRecorder.setAudioSamplingRate(44100);
Many solutions on stackoverflow would suggest .setAudioEncodingBiteRate(16) but 16 is too low to be considered meaningless .
Source: #Grant answer on stackoverflow very poor quality of audio recorded on my droidx using MediaRecorder, why?
Are you testing this with the emulator, or on an actual device (if so, which device)? The acoustic tuning (which includes gain control, noise reduction, etc) will be specific to a given platform and product, and is not something you can change.
Jellybean includes APIs to let applications apply certain acoustic filters on recordings, and a noise suppressor is one of those. However, by using that API you're limiting your app to only function correctly on devices running Jellybean or later (and not even all of those devices might actually implement this functionality).
Another possibility would be to include a noise suppressor in your app. I think e.g. Speex includes noise supressing functionality, but it's geared towards low-bitrate speech encoding.
https://developer.android.com/reference/android/media/audiofx/NoiseSuppressor.html
android voice recording - voice with background noice issue

Blank MP4 Video From Android Screen Capture in Emulator

I have been trying to capture the screen from Android Emulator and record it to a .mp4 file. I adopted the standard approach of creating a virtual display and routing the frames to an encoder, multiplexing the video channel and writing to the an external storage. However, the ouput .mp4 file is just a blank screen when played back. The same code works when run on a device.
One observation is that the BufferInfo.size from onOutputBufferAvailable() always has a constant value of 13 or 2718 which clearly indicates trouble with the MediaCodec encoder. Should I change some parameters when configuring the encoder?
Another observation is from Logcat that tells me that a SoftAVCEncoder is used when running in an emulator, which kinda indicates that some software encoding is used but still not sure why this does not work.

MediaPlayer issue - plays MP3s too fast (skips encoded silence)

So I have an app where mp3 file is being played using the MediaPlayer. On most devices everything is fine but on Samsung and some other (like HTC One S) devices the same mp3 plays "too fast" (skipping gaps): looks like player does not handle sound gaps (silence) correctly. These mp3s are just speech and speech naturally has gaps (silence) between spoken words. And these gaps are not played correctly in terms of time - MediaPlayer just skips them. As result mp3 is played faster by the duration of all gaps it contains.
What could be a reason and solution for this?UPDATEI'd found that its about frequency+VBR. Somehow if mp3 is of 22050/24000/32000 Hz instead of 44100 or 48000 and VBR or ABR is used the issue raises up. Im using LAME for mp3 encoding. If I remove "--resample 22.05" option so the resulting mp3 becomes 44.1kHz there is no issue playing this mp3 on samsung phone. However the resulting size of mp3 becomes twice bigger which is not acceptable for me cuz in this case my apk becomes bigger than 50Mb. So now the question is how to properly compress mp3 as 22kHz/VBR/MONO.
The issue was fixed in the following way: I added a white noise to an original sound and then encoded it to MP3 format. Resulting files became bigger in size but also they become more compatible (with Samsung devices) The original audio file (made at recording studio) is too clean meaning that silence/pauses in speech (between pronounced words) has no waveform if look in sound editor, its like an ideal silence. So on variuos Samsung devices such MP3-encoded files played with described issue. However on most other devices and PCs such MP3 files played just fine. Once again - Samsung "rules"!
You need to Google our for controlling playback speed in your application I mean to say that there must be some sort of 'playback rate' variable which must be a floating point value something between 0 to 1. This might help you in some workarounds for your app hope you find this somewhat helpful in anyway . O by the way here are some useful links that might help you out as well and if not then we have to keep waiting in the waiting queue for Samsung ;-) if its specifically related to them happy coding
http://code.google.com/p/android/issues/detail?id=1961
play an mp3 with MediaPlayer class on Android issues
Regards
Anas.

MediaRecorder.AudioSource.VOICE_CALL does not work on SGS2 (call recording)

Using mediarecorder to record calls, with setting the audio source to
MediaRecorder.AudioSource.VOICE_CALL
does not work on Samsung Galaxy S2 (Android 2.3.4), in the application freezes and no recording is created (VOICE_UPLINK/VOICE_DOWNLINK both work, but only record up/downlink, not both party voice).
However, e.g. the CallRecorder application (from Android Market) does work (recording both party voices). So it's possible.
How is it done?
I am trying to record through AudioSource.CAMCORDER on a Galaxy S2, but I have the same issue; I get no samples. Actually, I tried to have two audio sources, .MIC and .CAMCORDER, recording separate samples, but I guess, just like khan said, .MIC will probably work.

Voice Recognition with android emulator

im making an application on android that requires to capture the userĀ“s voice and recognize it. I tryed to record the audio using this code: http://xhampa.pastebin.com/Yr2hie6q on android 2.1. I realized that the sound wasn't recorded in a good quality at all (like slow motion). Unfortunally, I don't have an android to test it out, so I'm using the emulator. Is there anyway to improve record quality using the emulator?
The default recording quality when using mediarecorder is 4.75kbps and 8kHz, which is not adequate for any sort of audio processing. You simply need to change those values using the setAudioEncodingBitRate and setAudioSamplingRate methods.
setAudioSamplingRate(11.05)
setAudioEncodingBitRate(20)
The values that I included will optimize your audio quality, but you may need to change them to fit your needs.
Mediarecorder Documentation: http://developer.android.com/reference/android/media/MediaRecorder.html

Categories

Resources