Migrate to new API of jfreymuth/pulse

This commit is contained in:
Atsushi Watanabe
2020-04-28 13:09:26 +09:00
parent 29a1e692c8
commit e940ad6017
+3 -2
View File
@@ -87,11 +87,12 @@ func (m *microphone) AudioRecord(p prop.Media) (audio.Reader, error) {
samplesChan := make(chan []float32, 1)
handler := func(b []float32) {
handler := func(b []float32) (int, error) {
samplesChan <- b
return len(b), nil
}
stream, err := m.c.NewRecord(handler, options...)
stream, err := m.c.NewRecord(pulse.Float32Writer(handler), options...)
if err != nil {
return nil, err
}