You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
-support for stereo ima-adpcm sample compression & playback
-support for converting samples to ima-adpcm upon export
This commit is contained in:
@@ -491,8 +491,14 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
|
||||
ima_adpcm.last_nibble++;
|
||||
const uint8_t *src_ptr=sdata;
|
||||
|
||||
int ofs = ima_adpcm.last_nibble>>1;
|
||||
|
||||
if (stereo)
|
||||
ofs*=2;
|
||||
|
||||
|
||||
nibble = (ima_adpcm.last_nibble&1)?
|
||||
(src_ptr[ima_adpcm.last_nibble>>1]>>4):(src_ptr[ima_adpcm.last_nibble>>1]&0xF);
|
||||
(src_ptr[ofs]>>4):(src_ptr[ofs]&0xF);
|
||||
step=_ima_adpcm_step_table[ima_adpcm.step_index];
|
||||
|
||||
ima_adpcm.step_index += _ima_adpcm_index_table[nibble];
|
||||
|
||||
Reference in New Issue
Block a user