check size of script

This commit is contained in:
onyx-and-iris 2023-08-17 02:53:01 +01:00
parent 2ad8118f2c
commit 1df92afcfe

View File

@ -188,6 +188,9 @@ function Set_By_Script {
param( param(
[string]$script [string]$script
) )
if ($script.Length -gt 48000) {
throw [VMError]::new("Script size cannot be larger than 48kB")
}
$retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script) $retval = [int][Voicemeeter.Remote]::VBVMR_SetParameters($script)
if ($retval -notin @(0)) { if ($retval -notin @(0)) {
throw [CAPIError]::new($retval, "VBVMR_SetParameters") throw [CAPIError]::new($retval, "VBVMR_SetParameters")