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
1
Question by michael.ltn · Feb 26, 2014 at 03:48 PM · wwwstreammp3

WWW.getAudioClip() returning wrong length from one server but not another

The project has both a WebPlayer and iOS build. All text is narrated using audio files loaded from a media server. WebPlayer loads ogg files and iOS loads MP3 files.

There's a handful of clips that are coming in with extra silence added to the end of the track, but only when streaming MP3 and only from within Unity (both the Editor and on the device). If I enter the URL into a browser, it loads properly. One track is about 8 seconds long, but when I load the clip via the following script, the debug statement shows a length of over 16 seconds:

 WWW www = new WWW(GetURL(source));
 AudioClip clip = null;
 
 yield return www;
 
 if (www.error != null && www.error.Length > 0)
 {
     Debug.Log(www.error + "(" + source + ")");
 }
 else
 {
     #if UNITY_IPHONE
     clip = www.GetAudioClip(false, false, AudioType.MPEG);
     #else
     clip = www.GetAudioClip(false, false, AudioType.OGGVORBIS);
     #endif
 
     while (clip != null && clip.isReadyToPlay == false)
         yield return null;
 
     Debug.Log("Length of " + source + " is " + clip.length);
 }

Unfortunately, I can't provide a link to the audio files.

Has anyone experienced anything like this?

Comment
Add comment · Show 11
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 concave · Feb 27, 2014 at 07:40 PM 0
Share

iam trying to load mp3 on iosdevice the same way you do but i get no sound aswell as no error message. do you here any sound on the device? in editor switched to ios platform everythings works normal.i tried mp3 lame and propritery fraunhofer codec with constant bitrate but nothing worked for me. do you here a sound on device?

avatar image michael.ltn · Feb 28, 2014 at 01:42 AM 1
Share

concave: I do get sound to play on the device. Check your url in a browser. If the format is $$anonymous$$P3 and the extension is $$anonymous$$P3 and you're using AudioType.$$anonymous$$PEG, it should play. $$anonymous$$eep in $$anonymous$$d you have to yield until it's ready to play.

avatar image concave · Feb 28, 2014 at 09:19 AM 0
Share

what unity version do you use?

avatar image concave · Feb 28, 2014 at 09:35 AM 0
Share

are you on 4.3.4? (pro?)

avatar image concave · Feb 28, 2014 at 11:00 AM 0
Share

my audioclip never gets ready to play - the download from filesystem is successful - on www.bytes i get the right length of bytes but when i wait for isReadyToPlay after GetAudioClip it gets stuck in the loop without beeing null.

Show more comments

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

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Endless Audio streaming (Radio)?! 3 Answers

WWW load mp3 GetAudioClip without stream,play only a part,then no sound. 0 Answers

How do I properly stream music with WWWAudioExtensions? 1 Answer

can you stream audio from a person's iphone library 0 Answers

Saving the result of a WWW query? 0 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