Phi
Phi

Reputation: 115

How can android analyze realtime audio stream from mic?

I mean the frequency and other sound wave feature can be analyzed from the phone mic? Is there any guide about it?

I really appreciate any suggestion.

Upvotes: 2

Views: 4063

Answers (2)

Konstantin Pribluda
Konstantin Pribluda

Reputation: 12367

Good starting point,how to get uncompressed PCM data.

Upvotes: 1

Stephan Branczyk
Stephan Branczyk

Reputation: 9375

The answer is possibly in the book Pro Android Media published by Apress: "Chapter 8: Audio Synthesis and Analysis" > "Visualizing Frequencies" page 189.

You can download all the code examples directly from the Apress site. To be honest, that discrete Fourier transform example they give you is the only one that hasn't worked for me (even thought, I've tried all the other code examples in the book, and everything else worked perfectly).

The book itself is well written, so it should help you troubleshoot what's wrong with this example they give you. I just didn't take the time do this myself yet.

The book also mentions FFT (a fast Fourier transform), which is supposed to be much more efficient than a DFT (the discrete Fourier transform), but it says it won't cover that algorithm because a FFT is much more complex than a DFT to explain.

Upvotes: 1

Related Questions