aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-13 19:37:29 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 11:53:16 -0700
commit0c14f7d6aa068aadc98142fea20fa749bf03105b (patch)
tree0f6618e942869e042d5ea860ea5e5f4ca44bc46b /src
parent8e3d8b6dccb0f8b1e22a505c7216442781afcbd3 (diff)
Avoid the local data variable mask the data argument
Diffstat (limited to 'src')
-rw-r--r--src/library_openal.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index b51f426a..730cb544 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -237,20 +237,20 @@ var LibraryOpenAL = {
return;
}
AL.currentContext.buf[buffer - 1].buf = AL.currentContext.ctx.createBuffer(channels, size / (bytes * channels), freq);
- var data = new Array(channels);
+ var buf = new Array(channels);
for (var i = 0; i < channels; ++i) {
- data[i] = AL.currentContext.buf[buffer - 1].buf.getChannelData(i);
+ buf[i] = AL.currentContext.buf[buffer - 1].buf.getChannelData(i);
}
for (var i = 0; i < size / (bytes * channels); ++i) {
for (var j = 0; j < channels; ++j) {
switch (bytes) {
case 1:
var val = {{{ makeGetValue('data', 'i+j', 'i8') }}};
- data[j][i] = -1.0 + val * (2/256);
+ buf[j][i] = -1.0 + val * (2/256);
break;
case 2:
var val = {{{ makeGetValue('data', 'i+j', 'i16') }}};
- data[j][i] = -1.0 + (val + -32768) * (2/65536);
+ buf[j][i] = -1.0 + (val + -32768) * (2/65536);
break;
}
}