views:

1332

answers:

3

I'm trying to figure out how to write an app that can decode audio morse code on the fly. I found this document which explains how to record audio from the microphone in Android. What I'd like to know is whether it's possible to access the raw input from the microphone or whether it has to be written/read to a file.

Thanks.

A: 

It looks like it has to be dumped first to a file.

If you peek at the android.media.AudioRecord source: http://bit.ly/cFRRnS, the native audio data byte buffers are not exposed to the public API.

In my experience, having built an audio synthesizer for Android, it's hard to achieve real-time performance and maintain audio fidelity. A Morse Code 'translator' is certainly doable though, and sounds like a fun little project. Good Luck!

Dagwoody Djiboutay
Why do you think the audio buffers aren't passed to Java? What about the read() method?
dmazzoni
+2  A: 

If you use MediaRecorder (the example, above) it will save compressed audio to a file.

If you use AudioRecord, you can get audio samples directly.

Yes, what you want to do should be possible.

dmazzoni
A: 

Hi,

I was wondering if you made any progress on this. What I need is just a simple visualization of the current microphone input. It could be a bargram or a peak which reacts to the current input, showing just volume rate. It's supposed to be a feedback component so a user can perceive that the device is currently capable of recording. I found Audalyzer on Google code. It works nicely but I feel unable to pull out the bits I need. Any help on this?

Thanks in advance, Steff

steff
I haven't had time to work on that project, so no. If you figure anything out I'd love to hear it.
fiXedd