|
|
@ -60,7 +60,7 @@ func main() {
|
|
|
|
|
|
|
|
|
|
|
|
inDeviceConfig := malgo.DefaultDeviceConfig(malgo.Capture)
|
|
|
|
inDeviceConfig := malgo.DefaultDeviceConfig(malgo.Capture)
|
|
|
|
inDeviceConfig.Capture.Format = capture_device.Formats[0].Format
|
|
|
|
inDeviceConfig.Capture.Format = capture_device.Formats[0].Format
|
|
|
|
inDeviceConfig.Capture.Channels = 1
|
|
|
|
inDeviceConfig.Capture.Channels = capture_device.Formats[0].Channels
|
|
|
|
inDeviceConfig.Capture.DeviceID = capture_device.ID.Pointer()
|
|
|
|
inDeviceConfig.Capture.DeviceID = capture_device.ID.Pointer()
|
|
|
|
inDeviceConfig.SampleRate = capture_device.Formats[0].SampleRate
|
|
|
|
inDeviceConfig.SampleRate = capture_device.Formats[0].SampleRate
|
|
|
|
inDeviceConfig.PeriodSizeInFrames = 100
|
|
|
|
inDeviceConfig.PeriodSizeInFrames = 100
|
|
|
@ -69,7 +69,7 @@ func main() {
|
|
|
|
|
|
|
|
|
|
|
|
outDeviceConfig := malgo.DefaultDeviceConfig(malgo.Playback)
|
|
|
|
outDeviceConfig := malgo.DefaultDeviceConfig(malgo.Playback)
|
|
|
|
outDeviceConfig.Playback.Format = playback_device.Formats[0].Format
|
|
|
|
outDeviceConfig.Playback.Format = playback_device.Formats[0].Format
|
|
|
|
outDeviceConfig.Playback.Channels = 1
|
|
|
|
outDeviceConfig.Playback.Channels = playback_device.Formats[0].Channels
|
|
|
|
outDeviceConfig.Playback.DeviceID = playback_device.ID.Pointer()
|
|
|
|
outDeviceConfig.Playback.DeviceID = playback_device.ID.Pointer()
|
|
|
|
outDeviceConfig.SampleRate = playback_device.Formats[0].SampleRate
|
|
|
|
outDeviceConfig.SampleRate = playback_device.Formats[0].SampleRate
|
|
|
|
outDeviceConfig.PeriodSizeInFrames = 100
|
|
|
|
outDeviceConfig.PeriodSizeInFrames = 100
|
|
|
@ -90,7 +90,7 @@ func main() {
|
|
|
|
Data: onSendFrames,
|
|
|
|
Data: onSendFrames,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Printf("Creating playback device %+v\n", playback_device)
|
|
|
|
fmt.Printf("Creating playback device %+v with format %+v\n", playback_device, playback_device.Formats[0])
|
|
|
|
outDevice, err := malgo.InitDevice(ctx.Context, outDeviceConfig, playbackCallbacks)
|
|
|
|
outDevice, err := malgo.InitDevice(ctx.Context, outDeviceConfig, playbackCallbacks)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
panic(err)
|
|
|
@ -119,7 +119,7 @@ func main() {
|
|
|
|
Data: onRecvFrames,
|
|
|
|
Data: onRecvFrames,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Printf("Creating capture device %+v\n", capture_device)
|
|
|
|
fmt.Printf("Creating capture device %+v with format %+v\n", capture_device, capture_device.Formats[0])
|
|
|
|
inDevice, err := malgo.InitDevice(ctx.Context, inDeviceConfig, captureCallbacks)
|
|
|
|
inDevice, err := malgo.InitDevice(ctx.Context, inDeviceConfig, captureCallbacks)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
panic(err)
|
|
|
|