• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to Read Samples of an Audio File?

Hi,

I am a beginner to android SDK and have almost no idea of using it. But I have to do it in any case.

What I want is to select a .wav or .mp3 file stored on my android 2.2 phone. I want to read the samples of the audio file like 16 bit or 8 bit sample (whichever possible). Then I need to modify it and save the modified file back with some other name.

Please guide me that how can I get started by reading a .wav or .mp3 and reading its samples.

P.S.: I am a beginner. So, don't try to be over smart :)

Thank you.
 
I dont think there is any real-time access to audio data samples in the SDK or even the NDK at the moment. You can get the file bytes easy enough, but you need to understand what they represent. This is very, very far from a beginner's topic though. Just understanding how PCM data works is very complex, not to mention how mpeg 3 encoding works.

Anyways, I googled a bit and found libpd seems promising:

Some links:
libpd - Libpd - Open wiki - Gitorious

http://createdigitalmusic.com/2010/...-on-an-iphone-or-android-and-everywhere-free/


I'd also suggest you read up on PCM data. Just some possible places to start.

hth
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones