Record Android Audio Output
Asked Answered
S

6

51

Many people are asking for this, no one seems to have an answer so I do neither.

How is it possible that some apps serve the function to record the audio output of the android system? Everything I am finding is the very same tutorial on 1432 different sites where you can record MIC input. I don't care about mic input, I want the audio output and just can't imagine how to access it.

If everyone can get me on the right way, I would be so happy.

Selda answered 16/7, 2013 at 12:8 Comment(10)
"How is it possible that some apps serve the function to record the audio output of the android system? " -- got any links?Amadeo
Thanks for your answer but I lost my tablet a few days ago so I currently don't have any access to my apps. Is it important to get to know which apps are capable of doing that? I see you have a lot of knowledge about the android system it would be so great if you helped me. Greets, AlexSelda
"Is it important to get to know which apps are capable of doing that?" -- since, AFAIK, what you want is not possible (except by playing the audio through speakers and recording it through the microphone), yes.Amadeo
Really? Oh, I didn't know about that, I never tried these functions but maybe they really just accress the mic that's close to the speakers :/ I believe you, but do you know the reason why it should not be possible? I mean, what's the point of forbidding that?Selda
The fact that it is not technically possible at the SDK level does not imply that it is "forbidden", any more than it is "forbidden" to support Klingon via resource sets. BTW, I can't rule out the possibility that there's some way to do this recording at the NDK level with OpenSL -- that's outside my area of expertise.Amadeo
Although this post is too much old. But I want to suggest MediaProjection api which requires android 5.0 for recording system audio and screen, I have heard that it does not work for Android M(check it yourself) developer.android.com/reference/android/media/projection/…Culbert
@Culbert That doc now reads (possibly updated since you visited): "A screen capture session can be started through createScreenCaptureIntent(). This grants the ability to capture screen contents, but not system audio." The token may grant "applications the ability to capture screen contents and/or record system audio", but there seems to be no API actually implementing that audio capture.Gipps
I need something like this for testing accessibility.Rosie
Does this answer your question? How to record internal audio on Android devices or record MediaPlayer Audio Stream?Fatherhood
Chromecast has the feature to mirror video and audio to the TV. Could it be an option to implement a local Chromecast emulator and grab audio from there?Christlike
A
8

In Android 10, they have introduced Audio Playback Capture API using which we can capture the Audio being played by other applications. But it's not available in previous android versions.

An app X can also prevent any other app from listening, if that app hasn't added any constraint then this API can be used.

Acrodrome answered 21/2, 2020 at 6:18 Comment(1)
There is a detailed answer here if you want to check it out: #52543966Fatherhood
D
18

Seems to be currently there is no way to achieve this.

This is another question related to this : android get device overall audio output in pcm

Damon answered 9/9, 2014 at 9:22 Comment(0)
S
10

The closest API available to you for these purposes is Visualizer. Which only captures "partial and low quality audio content".

I imagine direct audio capture functionality is omitted to prevent pro-piracy apps. It may be worth noting that there is a CAPTURE_AUDIO_OUTPUT permission, but it is "Not for use by third-party applications". So if you really do have legitimate apps that are capable of this, as you claim, they are likely system apps. Even if you wrote an app that generated its own musical sequences, for example, you would still have to write your own encoder/decoder to achieve anything close to what you're asking for (and that wouldn't even be considered audio capture at that point.)

To put it bluntly, it's currently impossible without breaking any ToS with Google or your phone provider, and will probably remain so indefinitely.

Stenography answered 12/9, 2014 at 20:6 Comment(2)
There are many audio enhancement apps out there such as DSP manager and in my case VIPER they must have access to the system audio output (all output coming out of peripherals) right? Otherwise how would they enhance audio quality? If so a feature request to save the enhanced output in addition to streaming it from the developer should serve the purpose shouldn't it or am I missing something?Boltonia
@Boltonia Applying filters (e.g. using an equalizer) to audio output is not equivalent to actually capturing the output. See the AudioEffect API.Stenography
A
8

In Android 10, they have introduced Audio Playback Capture API using which we can capture the Audio being played by other applications. But it's not available in previous android versions.

An app X can also prevent any other app from listening, if that app hasn't added any constraint then this API can be used.

Acrodrome answered 21/2, 2020 at 6:18 Comment(1)
There is a detailed answer here if you want to check it out: #52543966Fatherhood
A
5

Just Use a bidirectional AUX Cable and hook it in your phone Headphone Port and hook it's another end to your Audio Interface "Line In" Channel (Or Whatever Input You have on your Audio Interface ) and then record that input by audacity or any good Audio Recorder.

Alrick answered 26/1, 2015 at 11:26 Comment(1)
I can't tell this to every single one of my usersSelda
A
4

TL;DR : use the SCR Screen Recorder app to capture video + internal audio (not microphone) [require root]

Long answer

Original answer: Record tablet's screen AND audio

Jeff's answer seems to be the only way you can use through adb. But that force you to do some work (merge video + audio).

I could do it this way :

- connect the Android device to computer with a jack cable (headphone output to microphone input);
- record video with adb shell;
- record audio with Audacity (or anything else)
- then merge video and audio with a video editor (pitivi, openshot, avconv...)

Another way is to directly use an android app:

SCR Screen Recorder:

  • pros :
    • the only app that truly works for recording video + internal audio with all devices
  • cons:

Mobizen for SAMSUNG:

  • pros
    • on google play store
  • cons
    • only the samsung version works for recording internal audio, the general or LG, XIAOMI version can't record internal audio
    • still a beta feature
    • require root for recording internal audio

RecMe:

  • pros
    • on google play store
  • cons
    • internal audio recording doesn't works on most devices
    • require root for recording internal audio

Personally I tried a lot of apps and the only working for me is SCR Screen Recorder.

PS : all these apps works without root if not using internal audio.

Ahmed answered 4/1, 2018 at 14:57 Comment(1)
About SCR, what is this app then : play.google.com/store/apps/… ? Doesn't it record audio?Menke
S
0

If you can enable adb access either via usb or network and have android >=10 then yes. Go here, read and install. https://github.com/rom1v/sndcpy

If you want easy full audio/video capture try: https://github.com/barry-ran/QtScrcpy

Sprint answered 25/3 at 16:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.