Android play two different songs on different earphones at the same time - android

I need to play different audio at the same time, one to the normal earphones and another one to the bluetooth earphones. (on Android...)
someone know if i can do this? how?
thanks!

android has three Streaming Types:
Ringtone & Notification, Media and Alarm.
you can use them to play different sounds but you can't play them in same time. there is an priority rank.

Related

How can I use an app (programming with Android Studio) to control the sound outputs of a device?

I would like to develop an app with which you can control the focus of individual sound outputs, so that you can, for example, play music with Spotify and at the same time play a video via Youtube, which then no longer has any sound. Is something like that even possible?
Thanks for an answer

Playing sound fast as possible

Now like does the question says, I need a way to play a small sound that lasts for like 1 second or less to play really quickly/fast in my Xamarin Android app. I am using .mp3 files and MediaPlayer class, is there any way to get as fast as possible to play a particular sound?

Google Chromecast receiver doesn't play simultaneous audio

I'm developing a Chromecast application (receiver, HTML5 and Javascript) which communicates with an Android app, all is fine, but I have a problem trying to play two "sounds" at a time in the receiver.
It's a kind of game where I need to play a song at the beggining and play some sound effects during it.
Is this possible? And if it is anyone could help me to do it? I have tried it and it works nice in the browser but in the Chromecast only one of the "sound" is played, the song or the effect, never both.
Thank you very much
You cannot have more than one active Media Element in your DOM in chromecast. For what you want to do, however, you can use Web Audio APIs and accomplish the same for short audio files.

Switch playing video to another video on chromecast device

I created a one sample app to validate filters for playing video on Chromecast.
When my device connects to Chromecast, it shows that it is connected and I'm able to play a video on Chromecast device. However, If I want to switch another video, I'm able to switch it and video plyaing also works fine.
But In this case, I want to update the UI, weather I'm playing a first video or second video? Is there any specific callback to know the mediaplayer status based on user selection on different videos.
Thanks in Advance!!
There is a lot of callbacks/listeners that report various changes that happen on the Cast side, such as OnMetadataUpdatedListener or OnStatusUpdatedListener (on Android sender side, similar ones exist on other platforms); I suggest you read our documentation and look through our sample or reference apps and then come back here with issues that you are running into, if any.

how to play different songs on left and right channels simultaneously on android device

Is it possible to play 2 different songs simultaneously on the left and the right channel on android device? I searched a lot to see if MediaPlayer class provides APIs to support that but in vain.
SoundPool has the file size restriction and I need to play files larger than 2 MB. Basically, I have a android player which plays single zone. Now I need the player to play 2 different songs simultaneously on the left and right output (speakers/earphone etc.) Is this possible? Any help is greatly appreciated.
Use two instances of AudioTrack.
I create plenty of them.
Usually devices let you go up to 24 or so.
All you need is two :-)
android play sound with AudioTrack
The setVolume() method takes two parameters, one for left, one for right.

Categories

Resources