Android Play Audio Continuously - android

I want to play one Audio file continuously that is being downloaded. Please note that there is no file of fixed size being sent from other side. It's like data is being send from one side and on the other side data is being received. I just want to make this data keep on playing (audio) until no further data is available.
Any suggestions on how to play audio data that is being sent continuously as soon as you start receiving it?

Related

Multiple and frequent playback notifications from Exoplayer PlayerNotificationManager for live-stream video played using exoplayer2

I am using Explayer PlayerNotificationManger to show playback notifications for live-stream video played using Exoplayer2.
I have followed this medium blog and implemented the same.
However, when the code runs on the device, it shows a notification every 3-4 second for a live-stream video. Please suggest something that I may not get multiple and frequent notifications when one notification is already visible to user.
If your notification, or notification channel is marked as high importance, every time the state is updated it will result in the notification alerting the user.
See this comment from an ExoPlayer contributor on GitHub.

Broadcasting Android application using Opentok SDK

Im working on an android application where multiple user subscribe to my stream published from android device. What i want to pull off is, when i click the video of a certain subscriber, all the subscriber(user) will then subscribe to his/her stream rather than mine.
if there is any article or code to suggest me, please do so.
I don't have a sample to point to but I can tell you how I would solve this.
You will need to communicate to everyone in the Session which stream to subscribe to. You can use the signal API in opentok to do this by passing a streamId along. Then when each participant receives that signal they can lookup the corresponding stream and subscribe to it. You will need to make sure that every time a new person joins you also send them a signal saying which stream to subscribe to. You can do this by listening for the connectionCreated event.
If only one participant is allowed to tell everyone who to subscribe to then you might want to have a look at the connection data property of tokens. Then you can add eg. 'admin' as the connection data and then when you receive the signals make sure that they are coming from someone that has 'admin' as their connection data.

Android : Playing audio file repeatedly on Push-Notification

I was wondering if there is a method to play an audio file on receiving a push notification. It's a short tone of 1second which I want to play for about 1minute at a gap of 10seconds each. Thus, playing the file 6 times in a minute.
This audio file is locally stored in the APP itself.
So, is there a way in which this can be done without running background services and when the app is closed?

Google play services simple chat implementation?

I am looking to create an extremely simple chat feature for my app.
I just want to be able to send a message to the opponent in my Turn-Based Multiplayer match.
I don't want to use libraries like Scringo and what have you. Is there any way to implement this?
I've tried to use Games.RealtimeMultiplayer.sendReliableMessage() but my players aren't in a room so it does not work.
In looking through the API, it appears that the only way to send out data is to call takeTurn
To take a turn, use this method:
Method Description
takeTurn()
Your game should only invoke this method when it is the user's turn in an active turn-based match. After invoking this method, the user sees this match under the Their Turn list in the match list UI.
If a participant ID is specified in the method call, that participant becomes the current player and can play a turn. The first time this happens to an invited player, the player receives an invitation notification. Subsequently, the player receives a turn notification.
If no pending participant ID is specified, the match state changes to MATCH_STATUS_AUTO_MATCHING. Your game can only leave the participant ID unspecified if there are player slots that are still vacant for auto-matching.
Your game can call takeTurn() with the current player as the pending participant. In this case, Play Games services uploads the the game data but no notification is sent.
There are no other calls that change the data that is held in the servers and passed to the other player(s).
Now, having said that, it IS possible to send out a chat for the player that currently owns the Turn. It would appear that there are two ways to do that, either include the Chat and set the Pending Participant to the Next Participant... or update only the Chat portion, and then call takeTurn with the Pending Participant set to the currently active Participant. Looking at the documentation, this would then update the Data held on Google's servers, BUT, would not necessarily send out any notification that it had updated, as it appears that Notifications are only sent out if it is actually to notify a Player that it is their turn. (if you envision your app as being open while the Player waited for others to complete, then it could poll for the data using getData(), as there is no requirement that I can see for it to be a Player's turn to request the Data().
This would allow a player to Chat, but not Real Time like you mention... as the API is strictly turn based.

Setting outgoing call to an mp3 music in android

Hi i want to make an android app in which when an incoming call come.it will be received and play an mp3 file in the sdcard.i know how to receive the intent of incoming call and pick it up.but in outgoing i have to play mp3 file please suggest some good reference for implementing it.

Categories

Resources