Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Jason 19 · Apr 26, 2011 at 02:53 PM · delaystreamingogg

How long should a streaming OGG audio take to start playing?

Hello - I'm having a strange problem using the WWW class and streaming a music file using .ogg format. The problem is that the clip doesn't signal the isReadyToPlay flag until several seconds have passed. If I print out the value of 'progress' on the WWW object it goes from 0.0 to 1.0 during this time. Only when it hits 1.0 does isReadyToPlay get set to true and then I can play the clip fine.

The music .ogg is around 5.5 megs big and it is taking roughly 13 seconds for isReadyToPlay to signal true. I'm downloading it on a fast internet connection. When I try FTPing the file from the website to my computer it takes about 7 seconds total.

So I'm a bit confused. I was hopeful that the .ogg would start playing a couple seconds after I issue the WWW request, but that doesn't seem to be the case at all. It seems like it is downloading the whole file before setting isReadyToPlay to true. There may be additional time to decompress the file in memory, but I'm not sure...the docs are somewhat sparse.

Can anyone shed some light on this for me? Thanks.

Code below:

void Start() { privateWww = new WWW(url); musicClip = privateWww.audioClip; }

void Update() { if (musicClip!=null && musicClip.isReadyToPlay && audioSource.isPlaying==false) { audioSource.clip=musicClip; audioSource.Play(); musicClip=null; } }

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yoyo · Apr 26, 2011 at 03:40 PM 0
Share

(edit: formatted code; please use the 1010 button to format code snippets and make your questions for readable, thanks!)

avatar image yoyo · Apr 26, 2011 at 03:43 PM 0
Share

Looks like you're doing it right, the docs indicate that isReadyToPlay should be true once enough data has been buffered, and I see you're pretty much copying the example code. I would normally fire the WWW request from a coroutine, but I don't see why that would make a difference.

avatar image Justin Warner · Apr 26, 2011 at 04:06 PM 0
Share

Just to add in, test with a really small sound file... It'll make testing easier. And as yoyo said, it should work.

avatar image JasonRD · Apr 26, 2011 at 06:46 PM 0
Share

A bit of clarification would help here: Is the 'progress' property indicating how much of the total clip has finished downloading, or is it indicating how much has downloading before isReadyToPlay is set to true? It would seem that it should be the former, but Unity is acting like its the latter.

avatar image JasonRD · Apr 27, 2011 at 05:59 PM 0
Share

Update for those with similar problems: It looks as if the slow ogg loading is only in the Editor. Strea$$anonymous$$g from the webplayer is just as quick as it should be.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Ogg Stream Live Video 0 Answers

Best practice: URL address for storing streamed music files 1 Answer

Trying to stream .ogg file in Mac OSX results in error without description 0 Answers

Play a ogg file in Unity3d says “Streaming of 'ogg' on this platform is not supported” 1 Answer

How can I convert a video to .ogg format and have it play from a web server? 7 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges