Skip to content

Commit

Permalink
Revert remove format
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKremer committed May 22, 2024
1 parent ff584c5 commit bc9f7e0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vorbis/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ func Decode(rc io.ReadCloser) (s beep.StreamSeekCloser, format beep.Format, err
return nil, beep.Format{}, err
}

channels := d.Channels()
if channels > 2 {
channels = 2
}

format = beep.Format{
SampleRate: beep.SampleRate(d.SampleRate()),
NumChannels: channels,
Precision: govorbisPrecision,
}

return &decoder{rc, d, make([]float32, d.Channels()), nil}, format, nil
}

Expand Down

0 comments on commit bc9f7e0

Please sign in to comment.