Skip to content

合并官方最新代码#1

Open
biallo wants to merge 16 commits into
developfrom
biallo/upgrade
Open

合并官方最新代码#1
biallo wants to merge 16 commits into
developfrom
biallo/upgrade

Conversation

@biallo

@biallo biallo commented Jan 17, 2019

Copy link
Copy Markdown

Proposed changes

Describe what this Pull Request does

Reason for changes

Explain why these changes should be made. Please include an issue # if applicable.

mzgoddard and others added 16 commits October 22, 2018 17:12
The extracted children can refer to their parent typed array views and
buffer to keep from needing to make memory copies that take a lot of
time to create and memory to use. As well some time can be saved by
using the same Uint8Array for reading Uint8 values and strings.
The number of samples in the ADPCM can be known once the data chunk is
extracted and the block size is known. From there the audio buffer can
be created and its channel data passed to the decompress method. A lot
of time is saved by writing to the channel data directly instead of
writing to one array, copying that to another array, and then finally
copying to the channel data. A surprising amount of time is saved by
using one getChannelData call instead of calling to store each sample.
There are 1424 possible deltas given 89 steps and 16 codes. We can
quickly compute those and reuse them to save time.

Knowing the exact size of the waveform we can re-author the
decompression loop to take advantage of that. We can place the block
header decompression first in the outer while loop and then place an
inner loop with the 2 samples per block decompression unwrapped. The
first sample reads from the stream and the second uses the other 4 bits.
…n-sounds

Handle empty and unusually formatted sounds that caused crashes
…decode-error

Catch ADPCM decode error, and use an empty sound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants