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 wraxul · Feb 21, 2013 at 06:27 PM · audiowwwaudioclipunity4

WWW GetAudioClip not working correctly for Unity 4?

I just upgraded to Unity 4 from 3.5 and ran into a problem. I was able to load mp3s from a user selected directory and play them in game, but now my code does not seem to load the audio at all. The following code is used to get the audio clip. Again, this worked fine before. Any help would be greatly appreciated!

         WWW www = new WWW(@"file://" + userFilePath);
 
         yield return www;
 
         if (www.error == null)
         {
             if (userFilePath.Contains(".mp3") || userFilePath.Contains(".Mp3") || userFilePath.Contains(".MP3"))
                 song.clip = www.GetAudioClip(false, true, AudioType.MPEG);
             
             www.Dispose();
         }
Comment
Add comment · Show 7
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 almostsync · Mar 29, 2013 at 01:27 PM 0
Share

I have the same problem, I also tried the new AudioType.AUDIOQUEUE with no success... ps. the problem remains with the newest update : 4.1.1f4

avatar image almostsync · Mar 29, 2013 at 03:09 PM 0
Share

a short bump, to focus the problem a bit. Loading the files locally, as in the example above, I cannot get a stream, loading the full file works (with a horrible full freeze on mobile devices, commented on in other threads, due to the load of such a large file), whereas loading an mp3 from a http server will work most of the time (some reported trouble here, but they seem to have gotten better with the latest update :)

avatar image Arcanor · Nov 11, 2013 at 05:00 AM 0
Share

Apparently this is still not working as of 4.2.2f1.

avatar image nnnnnn · Nov 14, 2013 at 02:07 PM 0
Share

great, i just submitted a similar question about WWW.GetAudioClip not working with OGG files inside Unity 4.2.2f1 (doesn't work with mp3s either)

:(

avatar image JeffreyD · Dec 06, 2013 at 05:09 PM 0
Share

I have the same problem with Unity V4.3.0f. I'm using the code from the post http://answers.unity3d.com/questions/392257/i-cant-use-wwwgetaudioclip.html

The code works very well with regard to listing the files in the directory on my hard drive, but the files will not play. When I look in the AudioSource in the inspector during run-time the name of the clip is not shown (I assume it should be), although an un-named clip symbol is shown. I there anyone out there that can confirm whether GetAudioClip() is working at all? and if it is what specific code do I need to get it to work. Thanks in advance for your help.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Wiki

Answer by Andy-Korth · Oct 15, 2014 at 08:15 PM

This issue seems fixed in Unity 4.5.4f1. I load my files with:

 AudioClip clip = www.GetAudioClip(false, false, AudioType.AUDIOQUEUE);

Be mindful of the path, especially on iOS when reading off the disk. Start with "file://". Default path locations have moved around in the most recent iOS version or two.

Comment
Add comment · Share
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

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

14 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

Related Questions

Issues with WWW resource loading 1 Answer

WWW.GetAudioClip Freeze 1 Answer

How to have www streaming to work with a radio station? 1 Answer

loading/streaming audioclip using www class [android] 0 Answers

How do i stream music from a server? 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