Commit 63200ea395503bf4a6a5951017c57b84771b88ce

Alon Zakai 2016-09-13T00:03:41

optimize a getValue

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c
index b48943c..2c97ffa 100644
--- a/src/audio/emscripten/SDL_emscriptenaudio.c
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c
@@ -127,7 +127,7 @@ HandleAudioProcess(_THIS)
                 }
 
                 for (var j = 0; j < $1; ++j) {
-                    channelData[j] = getValue($0 + (j*numChannels + c)*4, 'float');
+                    channelData[j] = HEAPF32[$0 + ((j*numChannels + c) << 2) >> 2];
                 }
             }
         }, buf, byte_len / bytes / this->spec.channels);