1. Are you ready for the Galaxy S20? Here is everything we know so far!

Record a call using AudioRecord and process audiou

Discussion in 'Android Development' started by gosom, Apr 27, 2012.

  1. gosom

    gosom Lurker
    Thread Starter

    I am trying to implement an application that records voice during a call ( my voice not the caller's ) and do some audio processing to that signal.

    For doing this I use AudioRecord class as following:

    Code (Text):
    1.  
    2.  
    3. private static final int RECORDER_SAMPLERATE = 8000;
    4.  
    5. private static final int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN_MONO;
    6.  
    7. private static final int RECORDER_AUDIO_ENCODING = AudioFormat.ENCODING_PCM_16BIT;
    8.  
    9. private static final int AUDIO_SOURCE = AudioSource.VOICE_UPLINK;
    10.  
    11. int N = AudioRecord.getMinBufferSize(RECORDER_SAMPLERATE, RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING);
    12.  
    13. recorder = new AudioRecord(AUDIO_SOURCE, RECORDER_SAMPLERATE, RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING, N*10);
    14.  
    15.  
    Then I use the recorder.read() method to read the recording to a buffer process them and write them to a file.

    When I try to hear the file with audacity the sound seems corrupted. Moreover I can hear also the caller's voice.

    I would like to note that my code works when the audio source is the MIC (not during a call).

    Is it something about the sample rate or some settings of the audio Recorder?

    Any other ideas how to implement this?

    Giorgos
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Record call using
  1. OnGoGS7A
    Replies:
    5
    Views:
    334
  2. Vishnu Keloth
    Replies:
    1
    Views:
    278
  3. neil154
    Replies:
    0
    Views:
    251
  4. Eric Monz
    Replies:
    2
    Views:
    276
  5. Moisdois10
    Replies:
    2
    Views:
    374
  6. melani78
    Replies:
    3
    Views:
    427
  7. melani78
    Replies:
    2
    Views:
    481
  8. melani78
    Replies:
    0
    Views:
    1,796
  9. Antonio Salazar
    Replies:
    4
    Views:
    813
  10. NSD Teja
    Replies:
    1
    Views:
    600

Share This Page

Loading...