Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 boribhi · Feb 10, 2010 at 07:35 PM · guiaudiofile-io

User choose audio from HardDisk/Cd

How to give the user the ability to choose the audio file(wav,mp3,ogg, etc) from his/her harddisk or CD and play it in a unity game? Note: I mean unity game does not contain that audio file but the user has it on his/her harddisk or CD.

Alternative Question: If this is not possible through programming/scripting nice user interface, is it possible for the user manually (ex, drag his MP3 file and "rename it" and put in a target folder saw unity game can "read" or play it?

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
0
Best Answer

Answer by Sebas · Feb 10, 2010 at 08:02 PM

It sounds like you are looking for a file browser for the user to choose a local file. Have a look at these questions:

Question1 Question2

You can find an example of a browser in the wiki (link) or this link might help (link)

Once the file is selected, you load the file and treat it like a normal audio clip.

Comment
Add comment · Show 1 · 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 Ashkan_gc · Feb 11, 2010 at 04:41 AM 0
Share

unity can just play ogg files and you should load them with www. to read other file formats like wave you need to convert them to ogg or use a plugin to play them.

avatar image
1

Answer by Ashkan_gc · Feb 11, 2010 at 04:56 AM

you can use the WWW class and it's audioclip property to load a file and play it. when you want to download the file if you put "file://path" inside the constructor of the class you can load files from the disk. the file should be in ogg format and you need a command line program or plugin to convert wave/mp3 files to ogg or you should play them using a plugin. in windows you can use windows media player's COM component or mci. i don't know about mac osx. the sample included in the above link shows you how to play audio. you should use a "file::path.ogg" as url string.

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

No one has followed this question yet.

Related Questions

Audio Question 2 Answers

Replacing Audio Files 0 Answers

Reading Wav file from a folder 0 Answers

GUI.Button Hover = Sound 1 Answer

Input a string and the computer answers with a command? 4 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