Add toDataView

This commit is contained in:
Vanilagy
2025-01-26 12:03:23 +01:00
parent d3566305df
commit b759fd8808
4 changed files with 10 additions and 4 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import {
mapAsyncGenerator,
promiseWithResolvers,
toAsyncIterator,
toDataView,
validateAnyIterable,
} from './misc';
import { fromAlaw, fromUlaw } from './pcm';
@@ -1015,7 +1016,7 @@ class PcmAudioDecoderWrapper extends DecoderWrapper<EncodedAudioSample, AudioDat
}
decode(sample: EncodedAudioSample) {
const inputView = new DataView(sample.data.buffer, sample.data.byteOffset, sample.byteLength);
const inputView = toDataView(sample.data);
const numberOfFrames = sample.byteLength / this.decoderConfig.numberOfChannels / this.inputSampleSize;