diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-02-11 11:28:55 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-02-11 11:29:29 -0300 |
commit | e46ffe5c66044bdb0168784c54c544b1569e1b66 (patch) | |
tree | 654293eed255090e96e83964a88632cbe9a3e4fc /tools/editor/io_plugins | |
parent | 285c400288e3a7ccb41d14b1751c88b09c1df294 (diff) |
-fixed more issues resampling sounds
Diffstat (limited to 'tools/editor/io_plugins')
-rw-r--r-- | tools/editor/io_plugins/editor_sample_import_plugin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index 47673f8f81..5408e43e1a 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -481,10 +481,10 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI float mu = pos-Math::floor(pos); int ipos = int(Math::floor(pos)); - float y0=data[MAX(0,ipos-1)]; - float y1=data[ipos]; - float y2=data[MIN(len-1,ipos+1)]; - float y3=data[MIN(len-1,ipos+2)]; + float y0=data[MAX(0,ipos-1)*chans+c]; + float y1=data[ipos*chans+c]; + float y2=data[MIN(len-1,ipos+1)*chans+c]; + float y3=data[MIN(len-1,ipos+2)*chans+c]; float mu2 = mu*mu; float a0 = y3 - y2 - y0 + y1; |