- Home /
audio stream current length
Given a streaming audio clip, is there any way to determine the currently downloaded length, or current buffered length (and total buffer size)? The WWW.progress field always returns 1, and the clip length always returns the full length, regardless of how much has streamed.
Answer by Marrt · Dec 10, 2012 at 02:19 PM
regarding full clip length you mean this 48xxxF (48k seconds) you get when calling .audioClip.length on a stream?
You cannot check the length of a stream until it finished loading all the Data. Additionaly, checking the length after it has finished causes a huge lag (0.5s, thats huge :D) http://forum.unity3d.com/threads/161750-Streaming-music-into-Webplayer-Lag-on-calling-audioClip-member-variable
i wanted to use this length information to determine when the streamed clip ended. Then i would start playing another stream i preloaded in between since the .isPlaying doesnt return 0 on a stream if the track ends. The Lag was causing me to scrap this approach.
Your answer
Follow this Question
Related Questions
Multiple audio recorders like Audio Listener. 0 Answers
WEB game how in the dozens of songs quickly switch? There is a good way to do 1 Answer
Unity download audio 1 Answer
Usage of DownloadHandlerAudioClip.streamAudio 1 Answer
Can Unity play live streamed video and audio sources continuously? 1 Answer