Beispiel #1
0
    /// <summary>
    /// Start ELIAS with a elias_event_set_level event. This function must not be called from more than one thread at the same time.
    /// </summary>
    public bool StartTheme(elias_event_set_level setLevel)
    {
        if (elias.Handle == IntPtr.Zero)
        {
            return(false);
        }

        if (AudioSettings.outputSampleRate == 0)
        {
            Debug.LogError("Unity's AudioSettings.outputSampleRate is reporting 0, so the Elias Plugin is unable to determine what sample rate would be correct to use! " +
                           "This may cause the speed of the audio to play at the wrong rate. Please set a sample rate for Unity in the Project settings.");
        }
        EliasWrapper.elias_result_codes r = EliasWrapper.elias_start_background_wrapped(elias.Handle, setLevel, AudioSettings.outputSampleRate != 0 ? (uint)AudioSettings.outputSampleRate : (uint)eliasSampleRate, (uint)eliasFramesPerBuffer);
        EliasHelper.LogResult(r, setLevel.ToString());
        return(r == EliasWrapper.elias_result_codes.elias_result_success);
    }
Beispiel #2
0
 /// <summary>
 /// Start ELIAS with a elias_event_set_level event. This function must not be called from more than one thread at the same time.
 /// </summary>
 public bool StartTheme(elias_event_set_level setLevel)
 {
     EliasWrapper.elias_result_codes r = EliasWrapper.elias_start_wrapped(elias.Handle, setLevel);
     EliasHelper.LogResult(r, setLevel.ToString());
     return(r == EliasWrapper.elias_result_codes.elias_result_success);
 }