|
While using unity2.6, we had this problem where the audio sound clip would cut out mid-way through playing towards the end of the clip. After upgrading to unity3.X we noticed this continued to happen. Is there any solution / workaround with the new version of unity? Thanks. (better code formatting...)
(comments are locked)
|
|
Everything checks out with me too. In fact, I programmed something not-to-different and it worked fine. Perhaps the issue is in your audio file? Unity might have troubles importing it off the net. DISCLAIMER: These .ogg URLs are provided by the Xiph Open Source Community. http://www.vorbis.com/music/Epoq-Lepidoptera.ogg <-- Recommended. Starts up fast, loud audio. http://www.vorbis.com/music/Hydrate-Kenny_Beltrey.ogg <-- Shortest one http://www.vorbis.com/music/Lumme-Badloop.ogg http://www.vorbis.com/music/Mists_of_Time-4T.ogg http://www.vorbis.com/music/The_Abyss-4T.ogg Source: http://www.vorbis.com/music/ I hope this helps. -- Flynn Doesn't work at all with 3.2 on Windows. Nor does the code straight from the docs: http://unity3d.com/support/documentation/ScriptReference/WWW.GetAudioClip.html
Feb 18 at 12:15 AM
Warwick Allison
(comments are locked)
|
|
Seems in 3.2 streaming does not work at all for OGG files: once you call WWW.audioClip, you've just got the samples for whatever OGG is so-far downloaded (not much when isReadyToPlay first becomes true!). The best I've been able to do is this horrible hack (basically reconvert from OGG once the bit that was downloaded is almost finished playing):
(comments are locked)
|
Unity Answers has moved to a new system, and some users may have trouble logging in.
are you checking AudioClip.isReadyToPlay before you start playing? ( http://unity3d.com/support/documentation/ScriptReference/AudioClip-isReadyToPlay.html )
when we want to play a streaming audio clip, the following coroutine gets started...
sorry for the poor formatting... as you can see, we are yielding for the audio clip's length, and then for good measure, yielding while the isPlaying flag is returning true on the audio component.
you can edit your question and put that code in it :)
Everything I would check looks fine there to me, I now defer to stronger minds...