Skip to content

Commit

Permalink
Exposed number of channes to calculate number of samples
Browse files Browse the repository at this point in the history
  • Loading branch information
csiwek committed Aug 8, 2019
1 parent e2f9404 commit 455df95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions opus.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type OpusReader struct {
stream io.Reader
fd *os.File
sampleRate uint32
channelCount uint16
Channels uint8
serial uint32
pageIndex uint32
checksumTable *crc32.Table
Expand Down Expand Up @@ -82,8 +82,7 @@ func (i *OpusReader) readOpusHead() error {
if err := binary.Read(i.stream, binary.LittleEndian, &version); err != err {
return err
}
var channels uint8
if err := binary.Read(i.stream, binary.LittleEndian, &channels); err != err {
if err := binary.Read(i.stream, binary.LittleEndian, &i.Channels); err != err {
return err
}
var preSkip uint16
Expand Down

0 comments on commit 455df95

Please sign in to comment.