remote-mic/main.go

38 lines
608 B
Go

package main
import (
"fmt"
"time"
"remote-mic/socketops"
"remote-mic/pulsectl"
)
func nop() {
fmt.Print("Listening for TCP connection on port 8080... ")
conn, err := socketops.AcceptConn(":8080")
if err != nil {
panic(err)
}
defer conn.Close()
fmt.Println("Connection accepted!")
data := make(chan []byte, 10)
go socketops.HandleConn(conn, data)
socketops.HandleData(data)
fmt.Println("Exiting.")
}
func main() {
pulsectl.LoadPipeSource(pulsectl.PipeSourceConfig{
"remote-mic",
"/dev/shm",
"s16le",
44100,
2,
})
time.Sleep(10 * time.Second)
pulsectl.UnloadPipeSource()
}