Search Unity

Clarification needed

Discussion in 'Audio & Video' started by Marionette, Dec 12, 2014.

  1. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    During some tests I came across some odd results. Put Debug.Log (Thread.CurrentThread.ManagedId); into the OAFR callback and see what happens.

    Requesting an explanation from Jan or UT please ;)

    Not sure what I'm seeing. New thread id every callback?
     
  2. drudiverse

    drudiverse

    Joined:
    May 16, 2013
    Posts:
    218
    indeed as Gregzo said:

    AppDomain.GetCurrentThreadId: This method is marked as deprecated because the .NET Thread object does not correspond to a single Windows thread, and as such there is no stable ID which can be returned by Windows for a given .NET thread.

    void OnAudioFilterRead(float[] data, int channels)
    {
    int id = System.AppDomain.GetCurrentThreadId();
    Debug.Log( id );
    }