Forum Discussion
freqout
8 years agoExplorer
Piping the output of an AudioSource into an OVRHapticsClip in realtime
Over on this documentation page, it suggests that "you may wish to write your own code to pipe the audio output of an audio source in realtime to a OVRHapticsClip, allowing you near-realtime conversion of audio into corresponding haptics data"
I'm interested in doing this, but I'm not really sure how this should be handled. I would presume that you would do this inside of OnAudioFilterRead() on the object that has your AudioSource, but I'm unclear on what method from OVRHapticsClip you would use to fill the buffer. Seems like the options are to set the Samples property or use the WriteSample function.
I'm also confused because the OVRHapticsChannel seems to mostly provide functionality for "one shot" style playback and what I'm looking to do is have it vibrate from an AudioSource when I call some kind of start function and then continuously do it until I call some kind of stop function. I don't really see any looping or circular buffer functionality. Is the idea to just keep on writing samples to the buffer until its a huge buffer?
It'd be great to see an example showing the basics of this functionality that is mentioned in the documentation page.
I'm interested in doing this, but I'm not really sure how this should be handled. I would presume that you would do this inside of OnAudioFilterRead() on the object that has your AudioSource, but I'm unclear on what method from OVRHapticsClip you would use to fill the buffer. Seems like the options are to set the Samples property or use the WriteSample function.
I'm also confused because the OVRHapticsChannel seems to mostly provide functionality for "one shot" style playback and what I'm looking to do is have it vibrate from an AudioSource when I call some kind of start function and then continuously do it until I call some kind of stop function. I don't really see any looping or circular buffer functionality. Is the idea to just keep on writing samples to the buffer until its a huge buffer?
It'd be great to see an example showing the basics of this functionality that is mentioned in the documentation page.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 years agoAnonymous