Android Question play ongoing music stream

yaniv hanya

Active Member
Licensed User
My app ran on a tablet connected to a sound amplifier.
I need to connect wirelessly (Bluetooth /wifi) to another device and receive a stream of music from it,
and play it in my amplifier (like the multimedia systems in cars).
I know how to copy the entire file to my device and then play it.
The Walkie Talkie from here also transfers closed files.
But how do I play om going stream from another phone on my device?
 

yaniv hanya

Active Member
Licensed User
To be more specifically, the phone is supposed to run another special app of mine
that should communicate with each other in other areas.
And I want my app that runs on the phone to broadcast to the app on the tablet either music or MP4 files.
In the app on the tablet I use MediaPlayer for music SimpleExoPlayer and for MP4.
Is there a way to connect the apps by the AsyncStreams lib or similar and play directly from the open stream?
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
you need to decode the file music file to WAV then extract audio frames from it and send these frames separately (as Walkie Talkie example)

use LibLame to decode MP3 files
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
you can extract the audio pcm frames from the mp4 files too but you might need to use java code or wrap library for this

check the java code in the first answer (not tested)
 
Upvote 0

yaniv hanya

Active Member
Licensed User
you need to decode the file music file to WAV then extract audio frames from it and send these frames separately (as Walkie Talkie example)

Sounds a bit complex. Is this what you do when connecting a BT headset?
(Which is basically what I need. I need the tablet to be used as a BT speaker)
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
Sounds a bit complex. Is this what you do when connecting a BT headset?
(Which is basically what I need. I need the tablet to be used as a BT speaker)
your Android device is A2DP source and the BT headset is A2DP Sink
you can only play music from A2DP source to A2DP Sink

maybe there is solutions to simulate A2DP Sink from Android device but i think it will be more complicated
 
Upvote 0

yaniv hanya

Active Member
Licensed User
Maybe you know how they did it in the new car audio systems,
which are also tablet type and play music from the phone and even play video from the phone.
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
Maybe you know how they did it in the new car audio systems,
which are also tablet type and play music from the phone and even play video from the phone.
check this links

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…