context.modules = [
{   name = libpipewire-module-filter-chain
    flags = [ nofail ]
    args = {
        node.description = "ONNX Example"
        node.name = "neural.example"
	audio.rate = 16000
        node.latency = "512/16000"
        filter.graph = {
            nodes = [
                {
                    type = builtin
                    name = copy
                    label = copy
		}
                {
                    type = onnx
                    name = onnx
                    label = {
			#filename = "/home/wim/src/silero-vad/src/silero_vad/data/silero_vad_half.onnx"
			filename = "/home/wim/src/silero-vad/src/silero_vad/data/silero_vad.onnx"
			blocksize = 512
			input-tensors = {
                            "input" = {
                                dimensions = [ 1, 576 ]
                                retain = 64
				data = "port:input"
                            }
                            "state" = {
                                dimensions = [ 2, 1, 128 ]
                                data = "tensor:stateN"
                            }
                            "sr" = {
                                dimensions = [ 1 ]
                                data = "param:rate"
                            }
                        }
                        output-tensors = {
                            "output" = {
                                dimensions = [ 1, 1 ]
                                data = "control:speech"
                            }
                            "stateN" = {
                                dimensions = [ 2, 1, 128 ]
                            }
                        }
		    }
		    control = {
		    }
		    config = {
		    }
                }
                {
                    type = builtin
                    name = noisegate
                    label = noisegate
		    control = {
                        "Open Threshold" 0.1
                        "Close Threshold" 0.02
		    }
		}
            ]
            links = [
                { output = "copy:Out"  input="onnx:input" }
                { output = "copy:Out"  input="noisegate:In" }
                { output = "onnx:speech"  input="noisegate:Level" }
	    ]
            inputs = [ "copy:In" ]
            outputs = [ "noisegate:Out" ]
        }

        capture.props = {
            node.name = "capture.neural"
	    audio.position = [ MONO ]
        }

        playback.props = {
            node.name = "playback.neural"
	    audio.position = [ MONO ]
        }
    }
}
]
