mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
017ad69e93
commit
00b530bfcc
@ -40,6 +40,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/audio/internal/convert"
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/hooks"
|
||||
)
|
||||
|
||||
@ -435,3 +436,13 @@ func (h *hookImpl) OnResumeAudio(f func() error) {
|
||||
func (h *hookImpl) AppendHookOnBeforeUpdate(f func() error) {
|
||||
hooks.AppendHookOnBeforeUpdate(f)
|
||||
}
|
||||
|
||||
// Resample explicitly resamples a stream to fit a new sample rate.
|
||||
//
|
||||
// If original sample rate matches the new one, Resample returns source as it is.
|
||||
func Resample(source io.ReadSeeker, size int64, from, to int) io.ReadSeeker {
|
||||
if from == to {
|
||||
return source
|
||||
}
|
||||
return convert.NewResampling(source, size, from, to)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user