Hi

I need to do something similar for my application and I looked into it about
a month ago but has since concentrated on another part of my app. I still
need to do it. So it's still something that I have to tackle.
I was thinking of doing was reading from the mic into a byte array and then
working on the data in that way. Something like:

int audioSource = MediaRecorder.AudioSource.
VOICE_DOWNLINK;
        int sampleRateInHz = 8000;
        int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;
        int audioFormat = AudioFormat.ENCODING_PCM_16BIT;
        bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz,
                channelConfig, audioFormat);
        AudioRecord recordInstance = new AudioRecord(audioSource,
                sampleRateInHz, channelConfig, audioFormat, bufferSize);
        recordInstance.startRecording();

And then read the buffer in real time to analyze and play with the data.
Something like:

byte buf[] = new byte[bufferSize];
int bytesRead = 0;

bytesRead = recordInstance.read(buf, 0, bufferSize)

If you find something else that is a better way. I would love to know.

-Chris


On Wed, Jan 27, 2010 at 10:06 AM, Donal Rafferty <draf...@gmail.com> wrote:

> Have you looked at the MediaRecorder class? As far as I know it allows some
> encoding and compression
>
>
> On Wed, Jan 27, 2010 at 5:04 PM, maecky <markus.feuerst...@gmail.com>wrote:
>
>> Push.
>> Does no one have any suggestions?
>>
>> regards Maecky
>>
>> On 17 Jan., 21:24, maecky <markus.feuerst...@gmail.com> wrote:
>> > Hi,
>> > I have searched the whole group but wasn't able to find a answer for
>> > my problem.
>> >
>> > I want to record audio from the microphone,  apply some audio signal
>> > processing and than save the processed audio data in a compressed
>> > format.
>> >
>> > I figured out, how to record audio uncompressed but now I wonder if I
>> > can use some api functions to store this data in a supported
>> > compressed format.
>> >
>> > Has anyone some suggestions?
>> >
>> > Thanks for your help
>> > regards Maecky
>>
>> --
>> 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<android-developers%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>  --
> 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<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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

Reply via email to