How to broadcast Audio file from AppWarpS2 Java Server to Client ?

0 votes
Hi,

I am working on audio quiz game, in that Java Server broadcast the Audio file to Clients.

So I don't  know the way how to do this.

please help me.

Thanks
asked Aug 26, 2015 in AppWarpS2 by imtiyaz.itengg (20 points)
The broadcast message type is string. so you can't send audio file via broadcast message. I think the only way to do this is that the client needs to have the specific audio file, and server only broadcasts the path or file name. The client then use the message to initialize the audio file.

1 Answer

+1 vote

Hi Imtiyaz,

Propheous is right, you can boradcast the file name or path if it is available with client application.

If there is a case where client does not have the audio file, then you can use the file Upload Service of App42 Cloud API to upload the file over the cloud. Uploading the file over the cloud provide you a URL which you can send in the message to the clients. When clients receive the URL then they can download it to use.

Let me know if it helps.

Thanks. 

answered Aug 27, 2015 by rajeev.etc (1,660 points)
I am working on Quiz app, so synchronization is important. If one client have slow internet and other have fast, then fast internet user or client see the audio question first and send its Answer but slow internet user still waiting for download. On same time all same room user see or listen Audio sound at a time.

do you have any other options apart from this like for Server send Audio file directly to Client through Broadcast method?
Slow internet will have same impact in case of broadcasting the audio file as well. To maintain the synchronization, you can write the custom logic on the server so that unless all the users have completed the download, the game should not start. In this case, every client in the room can send notification to the server if the download has been completed at his end.
Let me know if it helps.
Thanks ...
It is usefull
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...