swolekat
New Member
Hello,
I'm trying to write a lua script to move a source based on the audio level of an audio source. I am currently trying to get the audio levels by setting up ` obs_source_add_audio_capture_callback` (https://obsproject.com/docs/referen...ure_t#c.obs_source_add_audio_capture_callback ). In lua I pass in a function as the second parameter and I get this error:
```
[audio-to-move.lua] Error calling script_load: E:/gitRepositiories/obs-scripts/src/audio-to-move.lua:67: Error in obs_source_add_audio_capture_callback (arg 2), expected 'obs_source_audio_capture_t' got 'function'
```
Is there something special I need to do to get this function to work? I'm a bit new to lua but I couldn't see any way to coerce it to the correct type.
I've uploaded my script to here: https://github.com/swolekat/obs-scripts/blob/main/src/audio-to-move.lua#L68
I'm trying to write a lua script to move a source based on the audio level of an audio source. I am currently trying to get the audio levels by setting up ` obs_source_add_audio_capture_callback` (https://obsproject.com/docs/referen...ure_t#c.obs_source_add_audio_capture_callback ). In lua I pass in a function as the second parameter and I get this error:
```
[audio-to-move.lua] Error calling script_load: E:/gitRepositiories/obs-scripts/src/audio-to-move.lua:67: Error in obs_source_add_audio_capture_callback (arg 2), expected 'obs_source_audio_capture_t' got 'function'
```
Is there something special I need to do to get this function to work? I'm a bit new to lua but I couldn't see any way to coerce it to the correct type.
I've uploaded my script to here: https://github.com/swolekat/obs-scripts/blob/main/src/audio-to-move.lua#L68