audio_thread_priority

Bump a thread to real-time priority, for audio work, on Linux, Windows and macOS

10 breaking releases

new 0.11.0 May 24, 2019
0.9.0 May 24, 2019
0.3.0 Jan 25, 2018

#64 in Audio

Download history 2/week @ 2019-02-08 1/week @ 2019-02-15 3/week @ 2019-02-22 38/week @ 2019-03-01 5/week @ 2019-03-08 4/week @ 2019-03-15 17/week @ 2019-03-22 4/week @ 2019-04-05 3/week @ 2019-04-12 7/week @ 2019-04-19 7/week @ 2019-04-26 54/week @ 2019-05-03 76/week @ 2019-05-10 36/week @ 2019-05-17

84 downloads per month

MPL-2.0 license

24KB
403 lines

audio_thread_priority

Synopsis:

  // ... on a thread that will compute audio and has to be real-time:
  RtPriorityHandle handle;

  match promote_current_thread_to_real_time(512, 44100) {
    Ok(h) => {
      handle = h;
      println!("this thread is now bumped to real-time priority.") 
    }
    Err(...) => { println!("could not bump to real time.") }
  }

  // do some real-time work.

  match demote_current_thread_from_real_time(h) {
    Ok(...) => {
      println!("this thread is now bumped back to normal.")
    }
    Err(...) => {
      println!("Could not bring the thread back to normal priority.")
    }
  }

This library can also be used from C or C++ using the included header and compiling the rust code in the application. By default, a .a is compiled to ease linking.

License

MPL-2

Dependencies

~767KB