- Home /
[iOS] Streaming audio with loop
Hello everyone, I'm trying to use the WWW.getAudioClip for streaming music (local or in a webserver).
I have my streaming music playing and with the loop option in true, it works on Android. When the song gets the end it's looped right, but in iOS it keeps looping the last frame of music (0.2 seconds).
Anyone with this problem? Any idea?
In a short brief my code is something like this:
audio.clip = m_WWW.GetAudioClip(m_3DAudio, true, m_AudioType); if(audio.clip.isReadyToPlay == true && audio.isPlaying == false) { audio.loop = true; audio.Play(); }
As it makes the loop on the last frame of music I changed my function with :
audio.clip = m_WWW.GetAudioClip(m_3DAudio, true, m_AudioType); if(audio.clip.isReadyToPlay == true && audio.isPlaying == false) { audio.loop = false; audio.Play(); }
And in the update
if(audio.isPlaying == false) { audio.Play(); }
But Unity seems to don't get the end of the track.
Answer by Chopi · Jun 24, 2015 at 08:00 PM
It seems that the web server files are looping fine with
if(audio.isPlaying == false) { audio.Play(); }
But not with local files that are big.