- Home /
Audio Stuttering on Android Phone
First time actually asking a question here (longtime browser, found many a solution), so hopefully I don't come off too n00bish to all ye veteran programmers.
I'm having an issue with a simple trigger script in C# that enables a set of trigger game objects (every game object being an empty that holds a single trigger script which begins running with Start or OnEnable) when the audio completes. It's very straightforward (at least I think it is?) and works perfectly in the Unity Editor. However, when I build an APK and run it on an android device, the audio starts this horrific stuttering like it's getting stuck on short bursts of notes. It's extremely mystifying to me, especially since I have tried starting the audio in code the same way and using the same audio clip from another android project - and that one works perfectly when I generate the APK! I've checked the Audio Source component and it's not set on loop, so I'm really rather clueless why this is happening. Does anyone have any ideas what may be causing it?
Here's the script:
using UnityEngine;
using System.Collections;
public class AudioComplete : MonoBehaviour {
public AudioSource _audioSource;
public GameObject[] nextTriggers;
void Start () {
_audioSource.Play();
}
void FixedUpdate () {
if( !_audioSource.isPlaying )
{
foreach( GameObject nextTrigger in nextTriggers )
{
Debug.Log("Activating " + nextTrigger);
nextTrigger.SetActive(true);
}
this.gameObject.SetActive(false);
}
}
}
Thanks in advance.
Can you tell what is the importing setting set to "Load Type" for that audio? and how large is the audio file?
The Load Type is set to Decompress on Load, same as my other project. The file's original size is 1.09 $$anonymous$$Bs.
Your answer
Follow this Question
Related Questions
Read audio/music currently playing on speakers? 0 Answers
Android play mp3 file 0 Answers
Distribute terrain in zones 3 Answers
iOS/Android : Advanced sound management for Unity Free ? 0 Answers