protocol audioReconstruction is stream network(ps : unit, ss : unit, p : ip * udp * int * char^4 * int * blob) is let val dst : host = ipDst(#1 p) in (if (isMulticast(dst)) and (udpDst(#2 p) = 5002) then ( let val newdata : blob = changeData(charPos(#4 p), #9 p) in OnRemote(network, (fst(p), #2 p, #3 p, charVal(3), #5 p, #6 p, #7 p, #8 p, newdata)) end ) else ( OnRemote(network, p) ); (ps, ss) ) end fun changeData(t : int, b : blob) : blob = if (t = 4) then Resample16(b, -2) else if (t = 5) then Resample16(ScaleData(b, 1, 2), -2) else b