mirror of
https://github.com/pion/mediadevices.git
synced 2026-04-23 00:07:29 +08:00
Migrate to new API of jfreymuth/pulse
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user