|
|
|
@ -23,10 +23,10 @@ func main() {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
playback_device := infos[0].ID
|
|
|
|
|
playback_device := infos[0]
|
|
|
|
|
for _, info := range infos {
|
|
|
|
|
if info.IsDefault != 0 {
|
|
|
|
|
playback_device = info.ID
|
|
|
|
|
playback_device = info
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -36,17 +36,17 @@ func main() {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
capture_device := infos[0].ID
|
|
|
|
|
capture_device := infos[0]
|
|
|
|
|
for _, info := range infos {
|
|
|
|
|
if info.IsDefault != 0 {
|
|
|
|
|
capture_device = info.ID
|
|
|
|
|
capture_device = info
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inDeviceConfig := malgo.DefaultDeviceConfig(malgo.Capture)
|
|
|
|
|
inDeviceConfig.Capture.Format = malgo.FormatF32
|
|
|
|
|
inDeviceConfig.Capture.Channels = 1
|
|
|
|
|
inDeviceConfig.Capture.DeviceID = capture_device.Pointer()
|
|
|
|
|
inDeviceConfig.Capture.DeviceID = capture_device.ID.Pointer()
|
|
|
|
|
inDeviceConfig.SampleRate = 44100
|
|
|
|
|
inDeviceConfig.PeriodSizeInFrames = 100
|
|
|
|
|
inDeviceConfig.Alsa.NoMMap = 1
|
|
|
|
@ -55,7 +55,7 @@ func main() {
|
|
|
|
|
outDeviceConfig := malgo.DefaultDeviceConfig(malgo.Playback)
|
|
|
|
|
outDeviceConfig.Playback.Format = malgo.FormatF32
|
|
|
|
|
outDeviceConfig.Playback.Channels = 1
|
|
|
|
|
outDeviceConfig.Playback.DeviceID = playback_device.Pointer()
|
|
|
|
|
outDeviceConfig.Playback.DeviceID = playback_device.ID.Pointer()
|
|
|
|
|
outDeviceConfig.SampleRate = 44100
|
|
|
|
|
outDeviceConfig.PeriodSizeInFrames = 100
|
|
|
|
|
outDeviceConfig.Alsa.NoMMap = 1
|
|
|
|
|