Question by
NumNumDude · Jun 17, 2016 at 11:02 PM ·
androidaudio
AudioSource not playing on Android
I am developing an app for Android, and I'm trying to get it to play a clicking noise when the player taps and object. Pretty basic.
I have an AudioSource attached to the object and an active AudioListener on the camera. I'm trying to get it to play the clip using this code:
audio = gameObject.GetComponent<AudioSource>();
audio.PlayOneShot(tap, 1);
It plays on my Windows computer, but when I run it on my phone, it doesn't play the sound?
I know my touch-detecting script is fine because it switches scenes when you tap it like it's supposed too. But it just acts like the sound playing code isn't there?
Thanks in advance, feel free to ask for more info.
Comment