- Home /
How to get audio file as an AudioClip from its path
Before my question, i would like to say that i am NOT going to use Resources or WWW in my code...
now.. my question is: Is there any way of getting an audio file as an AudioClip with its path?
i have no idea on where to start from.. so I've tried using System.Media.SoundPlayer, but I get this error that says,
"The type or namespace name 'Media' does not exist in the namespace 'System'. Are you missing an assembly reference?"
I know it's not allowed to ask for a script but i might need a hint on where to start. or at least on how to fix that System.Media problem thing.
Thanks
Answer by SpecticalPro · Jun 25, 2013 at 07:00 PM
Maybe really simple but do you have
using System.Media;
at the top of your file, then throughout your code you should be able to say "new SoundPlayer"
if you've got this covered you may need to get the .dll file and copy it into your unity installation folder at Data\$$anonymous$$ono\lib\mono\2.0 with the rest of your dlls
Your answer
![](https://koobas.hobune.stream/wayback/20220613104836im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
GetDirectories() does not work on Android 1 Answer
Access Windows Shared Folder on Mac 1 Answer
Android - Access Video from StreamingAssets 0 Answers
delete files from app(documents directory) 1 Answer
Changing Exe Directory 1 Answer