Understood, I thought that this was straightforward. When attempting to record a phone conversation on Android v1.6 (by using the "MediaRecorder.AudioSource.VOICE_CALL" audio source parameter), at runtime an exception is thrown unexpectedly. The test is performed on the HTC ADP with firmware 1.6.
Here is the snippet of code, which causes the crash: recorder = new MediaRecorder(); int audioSource = MediaRecorder.AudioSource.VOICE_CALL; recorder.setAudioSource(audioSource); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); final String filePath = Environment.getExternalStorageDirectory() + "/ record.3gpp"; final File file = new File(filePath); file.getParentFile().mkdirs(); recorder.setOutputFile(filePath); recorder.prepare(); recorder.start(); // Recording is now started At runtime, when the "recorder.start()" method is executed, an exception is thrown , and in the DDMS log, I get: 09-30 15:35:09.812: ERROR/AudioFlinger(51): invalid stream type 09-30 15:35:09.812: ERROR/AudioRecord(51): AudioFlinger could not create record track, status: -22 09-30 15:35:09.812: ERROR/MediaRecorder(11204): start failed: -2147483648 I hope that the problem reporting is now clear enough. Thank you for your time. On Nov 19, 1:31 pm, Hetal Patel <heta...@gmail.com> wrote: > I'm deseperately trying to use the "VOICE_CALL" parameter, in order to > record both > the in and out audio streams during a phone call. When using > "VOICE_UPLINK" or > "VOICE_DOWNLINK" or "MIC", it works fine, however. > > At runtime, in the DDMS log, I get: > > 09-30 15:35:09.812: ERROR/AudioFlinger(51): invalid stream type > 09-30 15:35:09.812: ERROR/AudioRecord(51): AudioFlinger could not > create record > track, status: -22 > 09-30 15:35:09.812: ERROR/MediaRecorder(11204): start failed: > -2147483648 > > I'm running my test againt the ADP with the 1.6 firmware. Could > someone indicate > whether this problem is linked to the ADP drivers, or if it is > something which > resorts to Android v1.6, please? > > Thank you for your support. > > On Nov 19, 1:30 pm, Hetal Patel <heta...@gmail.com> wrote: > > > In Package > > > android.media > > > Classes MediaRecorder.MediaSource now after API Level 4 ( Android > > 1.6 ) Includes > > > 4 VOICE_CALL Voice call uplink + downlink audio source > > 3 VOICE_DOWNLINK Voice call downlink (Rx) audio source > > 2 VOICE_UPLINK Voice call uplink (Tx) audio source > > > See the Details here > > >http://developer.android.com/reference/android/media/MediaRecorder.Au... > > > On Nov 14, 5:04 am, Joachim Neumann <joac...@joachimneumann.com> > > wrote: > > > > Hi Roman and Nick, > > > > Looks like I have to exercise some patience with my plans to implement > > > a software hearing aid in a mobile phone. > > > > Thanks a lot for your explanations and the helpful link to embedded.com > > > > Joachim -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en