I’m trying to play a single mp3 file in an Android app, I’ve tried the following code:
private AudioSource engine; engine = gameObject.AddComponent<AudioSource>(); engine.playOnAwake = false; engine.clip = (AudioClip)Resources.Load("mustangengine"); engine.volume = 1.0F; engine.Play();
And nothing happens I mean I cannot listen any sound on the device and I don’t get any errors, no exceptions, no nothing. I’ve imported the mustangengine.mp3 file using Assets->Import new Asset
What am I doing wrong? If the script code is wrong could you please tell me how to do it? Any other way would be fine as long as it works!
Thanks in advance for your help.