My mobile app receives binary data stream from server socket and i want to play audio Realtime immediately. If server socket send data in 3 minutes, my mobile app will play audio in 3 minutes too. But the audio depends on sample rate. If sample rate is too high or too low, my mobile app will play audio faster or slower. Faster will get error when the audio cannot feed more data. How can i play audio synchronous with socket server.
Now, my code is like this:
Listen socket and push to queue, 4 first bytes is id so i remove it
oh sorry, my problem is the binary data is NOT PCM format, they are binary raw from mp3 file. how can i convert binary data from mp3 file to PCM format?
My mobile app receives binary data stream from server socket and i want to play audio Realtime immediately. If server socket send data in 3 minutes, my mobile app will play audio in 3 minutes too. But the audio depends on sample rate. If sample rate is too high or too low, my mobile app will play audio faster or slower. Faster will get error when the audio cannot feed more data. How can i play audio synchronous with socket server.
Now, my code is like this:
Listen socket and push to queue, 4 first bytes is id so i remove it
onFeed function