Skip to content

Commit

Permalink
Utilize audio property latency in microphone AudioRecord (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniels authored Aug 24, 2022
1 parent 58dc90d commit 3bec69b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/driver/microphone/microphone.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (m *microphone) AudioRecord(inputProp prop.Media) (audio.Reader, error) {
config.PerformanceProfile = malgo.LowLatency
config.Capture.Channels = uint32(inputProp.ChannelCount)
config.SampleRate = uint32(inputProp.SampleRate)
config.PeriodSizeInMilliseconds = uint32(inputProp.Latency.Milliseconds())
//FIX: Turn on the microphone with the current device id
config.Capture.DeviceID = m.ID.Pointer()
if inputProp.SampleSize == 4 && inputProp.IsFloat {
Expand Down

0 comments on commit 3bec69b

Please sign in to comment.