Play audio on microphone on Android device - android

I'd like to create an App that plays an audio file/stream to the microphone to allow a video communication App to capture the sound as input.
To Play the Audio I'm currently using the AudioTrack class.
The closest question is this one, but still unanswered.

Related

How to record internal audio?

I'm currently developing a mobile game that can be recorded while playing. And microphone is need during the game.
So I want to record the game background music, the game sound effects ,and
human voice from microphone.
I can record all the sounds through microphone now. But I can not hear the background music and sound effects clearly after the record is finished.
So,I want to know If I can record all the game sounds internally. I googled a lot And I found AudioRecord can do that by set the audio source to REMOTE_SUBMIX. But this is not allowed by non-system app in android.
So, is there any way to record internal audio in Android?

How to Pause audio in Exo MediaPlayer2 when other apps play audio/video?

I m using Exo Media Player 2.5.0 to stream audio from a remote source . i want to pause the audio when other apps play Audio/Video .
As ADM said, the only way to know if another app is going to play audio is by listening to audio focus changes (after requesting audio focus for your own app first, of course).
Aside from that, you're, unfortunately, at the mercy of the other app also playing nicely and it requesting audio focus when it wants to play.

Android MediaRecorder record voice only, not output

Writing an android application which will allow users to play music and record to that music. I've been using media player to play the background track and MediaRecorder to record in a background thread. When recording I get my voice from the mic and the output from the headphones. Is there a way to stop the output stream from being recorded as well? I'm using a 2012 Galaxy Nexus phone to test this.
I was using headphones with try connector which I think was the culprit. I tried with a regular trs connector and I only received the microphone feed.

Android media playback - stop audio output completely?

I have an app that plays video files with no audio. I'm using the mediaplayer function. I want to have the videos play, but not output anything to audio, as there is no audio tracks. However, Android ducks all other audio output (music, for example) when my app is running. Is there a way to use mediaplayer and completely remove my app from audio streams?
I've reviewed Google's Managing Audio Focus article, and I can't devise a way to do so. I just want to use mediaplayer for the video, and completely forget about audio.
Is there a different function I have to call in mediaPlayer.setAudioStreamType?
you can mute all the audio streams using the below code snippet
AudioManager am = (AudioManager)NextVideoPlayer.this.getSystemService(Context.AUDIO_SERVICE);
am.setStreamMute(AudioManager.STREAM_MUSIC, true);

audio record through ear phone in android?

I want to record user's singing for karaoke. I used audio recorder API of android to record audio. My requirement is to record only user's singing for karaoke, I do not want karaoke getting mixed with user's singing. So I used ear phone to listen to karaoke and record user's singing through ear phone. My problem is, in some of the device karoake gets mixed with users singing. Also audio quality is very bad. I'm using MIC audio source with 8000 frequency and channel in mono. I got little success with audio source camcoder but recorded audio is of low quality. Is there any way to improve audio quality? Also is camcoder is supported in all device? Is there any other way to record only users singing?. Your response will be helpful. Thank you.

Categories

Resources