Record AudioStream that is being played and store it in a file.

63 views
Skip to first unread message

Raj

unread,
Sep 29, 2011, 6:54:16 AM9/29/11
to andro...@googlegroups.com
Hello,

After googling for good 5 days I finally came to the conclusion that this cannot be done using plain SDK. So, I hope to get an answer for this using NDK.

In my app, I am playing some music on click of some buttons. Now, what I want to do is, whatever is getting played on click of those buttons, I just want that stream which goes to the device speakerphone or headphone and store it in a file.
In short words, I want that stream which is being played as music to be recorded in a file. Please help.

David Turner

unread,
Sep 29, 2011, 3:44:45 PM9/29/11
to andro...@googlegroups.com
I'm sorry, but if it can't be done with the SDK, it probably can't be done with the NDK.

The NDK doesn't give your application additional permissions.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/OAJEP3Icl0MJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

mic _

unread,
Sep 29, 2011, 3:53:36 PM9/29/11
to andro...@googlegroups.com
What kind of audio are you playing in your app? PCM? Or compressed audio (mp3, vorbis, aac,...)?
If it's PCM you could just write the output to a file at the same time as playing it. 

The only way I could think of to write the Android output streams to a file would be to modify libaudio or libaudioflinger. That would essentially mean a custom ROM, so it's not something you can do with the SDK or NDK.

/Michael

Glenn Kasten

unread,
Sep 29, 2011, 6:06:30 PM9/29/11
to android-ndk
I'll add one more workaround for compressed/encoded audio that's your
own content  (not content coming from a different application) ... you
could use a suitably-licensed open source software decoder bundled
into your app (probably via NDK) to decode the content to PCM, then
use Michael's approach in his paragraph 1.

On Sep 29, 12:53 pm, mic _ <micol...@gmail.com> wrote:
> What kind of audio are you playing in your app? PCM? Or compressed audio
> (mp3, vorbis, aac,...)?
> If it's PCM you could just write the output to a file at the same time as
> playing it.
>
> The only way I could think of to write the Android output streams to a file
> would be to modify libaudio or libaudioflinger. That would essentially mean
> a custom ROM, so it's not something you can do with the SDK or NDK.
>
> /Michael
>
>
>
>
>
>
>
> On Thu, Sep 29, 2011 at 9:44 PM, David Turner <di...@android.com> wrote:
> > I'm sorry, but if it can't be done with the SDK, it probably can't be done
> > with the NDK.
>
> > The NDK doesn't give your application additional permissions.
>
Reply all
Reply to author
Forward
0 new messages