• 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 K1kk0z90_Unity · Sep 20, 2015 at 05:40 AM · audiowwwaudioclip

WWW.audioClip error: Unable to determine the audio type from the URL

I am attempting to play an audio clip retrieved from the web, using the WWW class.

 WWW www = new WWW(url);
 AudioClip clip = www.audioClip;

The problem is that www.audioClip is null, and I get the following error message to console:

Unable to determine the audio type from the URL (my url to my sample) . Please specify the type.

UnityEngine.WWW:get_audioClip()

If I visit the supplied URL I can download the sample, that is an MP3 file. I think the problem is this: the URL provided to WWW does not end with the name of the file plus the extension! So my question is: if the problem is what I think, how can I specify the type of audio file so that the WWW class knows it's going to download an MP3 file?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by K1kk0z90_Unity · Sep 20, 2015 at 07:46 AM

Silly me, it was so easy but I didn't figure it out. :) In this case I can use the WWW.GetAudioClip() method instead of directly getting the audioClip property. The third parameter of the said method is an enum corresponding to the audio type.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

29 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Issues with WWW resource loading 1 Answer

Unable to import songs using NAudio 1 Answer

WWW.GetAudioClip Freeze 1 Answer

WWW GetAudioClip not working correctly for Unity 4? 1 Answer

How to avoid lag when using WWW class to download sound 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges