;; Audio Input and Net Send example


;; Impromptu has limited support for audio input

;; 1) *au:input-node* is created automatically and

;;    only supports output 1 (the devices first stereo pair)

;; 2) The output device and input device must be the

;;    same.  Therefore impromptu automatically uses

;;    the default output device for input if possible.


;; This example also uses netsend and net receive for

;; streaming audio across a network.


;; NOTE:  Make sure host and client firewalls are off.




; define a filter

(define filter (au:make-node "aufx" "filt" "appl"))

; stream audio data to any listening host

(define netsend (au:make-node "aufx" "nsnd" "appl"))

; connect input to filter (*au:input-node* always uses it's second output i.e. 1)

(au:connect-node *au:input-node* 1 filter 0)

; connect filter to netsend a streaming server

(au:connect-node filter 0 netsend 0)

; connect netsend to output so we can hear output locally as well as streaming

; to any listening hosts.  Benjour should automatically connect any net receives

; listening on the local broadcast domain.

(au:connect-node netsend 0 *au:output-node* 0)


; stuff with the filter

(au:open-view filter)

; check netsend out

; open another impromptu on another host on the same subnet

; connect a net receive directly to au:output-node like this

; (define netrcv (au:make-node "augn" "nrcv" "appl"))

; (au:connect-node netrcv 0 *au:output-node* 0)

; (au:update-graph)

; (au:open-view netrcv)


; make sure host and client firewalls are turned off

; and everything should just work :)


(au:open-view netsend)