• 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 adam michaels · Mar 01, 2010 at 06:35 PM · movietexture

How to Load Movie Texture Audio from Resources in Script?

Your docs for using Movie Texture describe how to play movie audio by drag/drop of the Audio Clip onto an AudioSource.

I have my videos located under Resources and am loading them with script by name. But I can't seem to figure out the correct name for the audio clip resource associated with the movie. I tried things like "{MovieTextureName} audio", etc... but it cannot locate the audio clip resource.

What is the naming scheme that I should use to load the Audio Clip from Resource folder using Script?

         Resources.Load(audioClipPath, AudioClip);

In this line of code, what should "audioClipPath" be?

Thanks!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Tetrad · Mar 30, 2010 at 04:53 PM

MovieTexture movieTexture = (MovieTexture)Resources.Load( movieTexturePath, MovieTexture );
AudioClip movieAudioClip = movieTexture.audioClip;
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
avatar image
1

Answer by jonas-echterhoff · Mar 02, 2010 at 12:10 PM

audioClipPath should just be the movie asset. So if your Movie is in "Assets/Resources/Movie.mov", audioClipPath should be "Movie".

Comment
Add comment · Show 2 · 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
avatar image adam michaels · Mar 03, 2010 at 11:41 PM 0
Share

That was the 2nd thing I tried, and it did not locate the resource. Per my other "question", I have resolved this now by doing a manual export of our audio clip to a separate Ogg formatted file, and am importing it from there. So our critical issue is now resolved.

Thanks for the response!

avatar image jonas-echterhoff ♦♦ · Mar 04, 2010 at 09:20 AM 0
Share

Hmm, that is strange though. Because, before I posted a reply a made a quick test run, to verify that what I wrote made sense, and I was able to get the AudioClip just like that.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Problems using MovieTextures - Gets white everytime on Unity Pro trial 1 Answer

www.movie not playing? 1 Answer

Image Sequence in unity without using .gifs for a crowd 2 Answers

using WWW to load ogv onto MovieTexture (winStore) 0 Answers

how i can have "Movie Texture"s on my Android games ? 1 Answer


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