Esempio n. 1
0
    public void PlaySound(eSound enumS, int loop)
    {
        AndroidNativeAudio.setVolume(SoundID[(int)enumS], GameManager.Instance.AudioVolume);
        SoundID[(int)enumS] = AndroidNativeAudio.play(FileID[(int)enumS], GameManager.Instance.AudioVolume);
        AndroidNativeAudio.setVolume(SoundID[(int)enumS], GameManager.Instance.AudioVolume);

        AndroidNativeAudio.setLoop(SoundID[(int)enumS], loop);
        //for (int i = 0; i < System.Enum.GetValues(typeof(eSound)).Length; i++)
        //{
        //    SoundID[i] = AndroidNativeAudio.play(FileID[i]);
        //}
        //Debug.Log("GameManager.Instance.AudioVolume" + GameManager.Instance.AudioVolume);
    }
Esempio n. 2
0
    void ModifySound()
    {
        // These aren't necessary, but show how you could work with a loaded sound.

        AndroidNativeAudio.pause(SoundID);
        AndroidNativeAudio.resume(SoundID);
        AndroidNativeAudio.stop(SoundID);

        AndroidNativeAudio.pauseAll();
        AndroidNativeAudio.resumeAll();

        AndroidNativeAudio.setVolume(SoundID, 0.5f);
        AndroidNativeAudio.setLoop(SoundID, 3);
        AndroidNativeAudio.setPriority(SoundID, 5);
        AndroidNativeAudio.setRate(SoundID, 0.75f);
    }
 public int PlaySFXLoop(string name, float pitch = 1, float volumeFactor = 1)
 {
     PlaySFX(name, pitch, volumeFactor);
     AndroidNativeAudio.setLoop(currentSFXStreamID, -1);
     return(currentSFXStreamID);
 }