How to program a real-time accurate audio sequencer on the iphone?

后端 未结 9 611
北荒
北荒 2021-01-30 02:56

I want to program a simple audio sequencer on the iphone but I can\'t get accurate timing. The last days I tried all possible audio techniques on the iphone, starting from Audio

9条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 03:26

    im doing something similar using remoteIO output. i do not rely on NSTimer. i use the timestamp provided in the render callback to calculate all of my timing. i dont know how acurate the iphone's hz rate is but im sure its pretty close to 44100hz, so i just calculate when i should be loading the next beat based on what the current sample number is.

    an example project that uses remote io can be found here have a look at the render callback inTimeStamp argument.

    EDIT : Example of this approach working (and on the app store, can be found here)

提交回复
热议问题