2

i have an issue , i hire someone to make music app , but when we try to play audio file located in server , it gave some latency 6-8 seconds , in other music app it takes milliseconds only , how can we make suck like that speed of playing

closed as off-topic by beeshyams, Andy Yan, Dan Hulme Mar 21 '17 at 16:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about writing and publishing Android apps, writing custom ROMs, and other topics that are primarily of concern to developers are off-topic. Consider taking advantage of other resources that may be appropriate for your question." – beeshyams, Andy Yan, Dan Hulme
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This reads like a development question. This site is for users of Android, which means that questions about development/programming are off-topic here (see the What topics can I ask about here?). Development questions are on-topic on Stack Overflow. – wbogacz Mar 18 '17 at 16:29
  • I presume it was posted here because it involves an Android app. – SDsolar Mar 18 '17 at 18:51
0

It sounds like the answer will turn out to be related to the power-saving settings on your server. Specifically, the timeouts on the hard drives.

If it takes milliseconds it is probably because the drive is already spinning, and when it takes 6-8 seconds it is probably because the drive has powered down and needs to spin up before looking for the file.

Having more than one drive exacerbates this problem. If a music file is playing for some time on one drive, another might spin down. Picking another song from the first drive will play very soon, but picking something from the other drive will involve some time lag before the drive is ready.

But it can also happen on a single drive if the music file is first loaded into RAM before playing. In that case, short songs will finish before the drive spins down, but longer ones might give it time enough to see no activity and think it isn't needed.

My recommendation is always to disable power-saving mode on hard drives. They tend to last longer if they are not constantly being turned off and on all the time.

Not the answer you're looking for? Browse other questions tagged or ask your own question.