mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio/mp3: Refactoring
This commit is contained in:
parent
9130c490c2
commit
3be2b2516f
@ -58,8 +58,9 @@ func Decode(context *audio.Context, src audio.ReadSeekCloser) (*Stream, error) {
|
||||
var s audio.ReadSeekCloser = d
|
||||
size := d.Length()
|
||||
if d.SampleRate() != context.SampleRate() {
|
||||
s = convert.NewResampling(s, d.Length(), d.SampleRate(), context.SampleRate())
|
||||
size = size * int64(context.SampleRate()) / int64(d.SampleRate())
|
||||
r := convert.NewResampling(s, d.Length(), d.SampleRate(), context.SampleRate())
|
||||
s = r
|
||||
size = r.Size()
|
||||
}
|
||||
return &Stream{
|
||||
inner: s,
|
||||
|
Loading…
Reference in New Issue
Block a user