Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
Fix failure to build with Go 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Aug 16, 2020
1 parent efc6895 commit cc618d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/frameheader/frameheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ func (f FrameHeader) SamplingFrequency() consts.SamplingFrequency {
func (f FrameHeader) SamplingFrequencyValue() int {
switch f.SamplingFrequency() {
case 0:
return 44100 >> f.LowSamplingFrequency()
return 44100 >> uint(f.LowSamplingFrequency())
case 1:
return 48000 >> f.LowSamplingFrequency()
return 48000 >> uint(f.LowSamplingFrequency())
case 2:
return 32000 >> f.LowSamplingFrequency()
return 32000 >> uint(f.LowSamplingFrequency())
}
panic("not reached")
}
Expand Down Expand Up @@ -126,7 +126,7 @@ func (f FrameHeader) BytesPerFrame() int {
}

func (f FrameHeader) Granules() int {
return consts.GranulesMpeg1 >> f.LowSamplingFrequency() // MPEG2 uses only 1 granule
return consts.GranulesMpeg1 >> uint(f.LowSamplingFrequency()) // MPEG2 uses only 1 granule
}

// IsValid returns a boolean value indicating whether the header is valid or not.
Expand Down Expand Up @@ -188,7 +188,7 @@ func (f FrameHeader) Bitrate() int {
func (f FrameHeader) FrameSize() int {
return ((144*f.Bitrate())/
f.SamplingFrequencyValue() +
int(f.PaddingBit())) >> f.LowSamplingFrequency()
int(f.PaddingBit())) >> uint(f.LowSamplingFrequency())
}

func (f FrameHeader) SideInfoSize() int {
Expand Down

0 comments on commit cc618d1

Please sign in to comment.