rorywalsh / CsoundUnity

GNU Lesser General Public License v2.1
70 stars 19 forks source link

Adjust AudioSource pitch by comparing AudioSettings and Csound sr #31

Closed Despair-Bear closed 2 years ago

Despair-Bear commented 2 years ago

Found that adjusting the pitch of an AudioSource reduces the rate at which OnAudioFilterRead is called. This allows for a lower sample rate to be used in the Csound instance and Unity will read from said instance at the appropriate sample rate. Allows for major improvement in resource consumption when less than high quality audio required.

Need to test this out on a more recent Unity version tomorrow, am running an older version of Unity (2019.4.9f1). Will verify all is good in more recent versions tomorrow evening.

Despair-Bear commented 2 years ago

Sorry, closed this, my local environment was still linked to one of my old accounts and I didn't realize it. Recreated this PR