audio/internal/convert: Change the window smaller for performance

On iOS, resapling performance was not good.
This commit is contained in:
Hajime Hoshi 2017-12-31 00:14:52 +09:00
parent 97ec367e23
commit 03942292f5

View File

@ -127,10 +127,7 @@ func (r *Resampling) src(i int) (float64, float64, error) {
} }
func (r *Resampling) at(t int64) (float64, float64, error) { func (r *Resampling) at(t int64) (float64, float64, error) {
windowSize := 8.0 windowSize := 4.0
if web.IsBrowser() {
windowSize = 4.0
}
tInSrc := float64(t) * float64(r.from) / float64(r.to) tInSrc := float64(t) * float64(r.from) / float64(r.to)
startN := tInSrc - windowSize startN := tInSrc - windowSize
if startN < 0 { if startN < 0 {