Skip to content

Commit f374af7

Browse files
authored
Fix some typos in OpenAL implementation. (#22073)
1 parent ba623af commit f374af7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/library_openal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ var LibraryOpenAL = {
726726
if (src.bufQueue[src.bufsProcessed].audioBuf !== null) {
727727
src.bufsProcessed = 0;
728728
while (offset > src.bufQueue[src.bufsProcessed].audioBuf.duration) {
729-
offset -= src.bufQueue[src.bufsProcessed].audiobuf.duration;
729+
offset -= src.bufQueue[src.bufsProcessed].audioBuf.duration;
730730
src.bufsProcessed++;
731731
}
732732

@@ -3071,7 +3071,7 @@ var LibraryOpenAL = {
30713071
return;
30723072
}
30733073
switch (param) {
3074-
case 'AL_SOURCE_DISTANCE_MODEL':
3074+
case 0x200 /* AL_SOURCE_DISTANCE_MODEL */:
30753075
AL.currentCtx.sourceDistanceModel = true;
30763076
AL.updateContextGlobal(AL.currentCtx);
30773077
break;
@@ -3093,7 +3093,7 @@ var LibraryOpenAL = {
30933093
return;
30943094
}
30953095
switch (param) {
3096-
case 'AL_SOURCE_DISTANCE_MODEL':
3096+
case 0x200 /* AL_SOURCE_DISTANCE_MODEL */:
30973097
AL.currentCtx.sourceDistanceModel = false;
30983098
AL.updateContextGlobal(AL.currentCtx);
30993099
break;
@@ -3115,7 +3115,7 @@ var LibraryOpenAL = {
31153115
return 0;
31163116
}
31173117
switch (param) {
3118-
case 'AL_SOURCE_DISTANCE_MODEL':
3118+
case 0x200 /* AL_SOURCE_DISTANCE_MODEL */:
31193119
return AL.currentCtx.sourceDistanceModel ? {{{ cDefs.AL_FALSE }}} : {{{ cDefs.AL_TRUE }}};
31203120
default:
31213121
#if OPENAL_DEBUG

test/openal_playback.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ int main() {
257257
#elif defined(TEST_ANIMATED_LOOPED_DOPPLER_PLAYBACK)
258258
printf("You should hear a continuously looping clip of the 1902 piano song \"The Entertainer\" played back at a dynamic playback rate that smoothly varies its pitch according to a sine wave doppler shift. Press OK when confirmed.\n");
259259
#elif defined(TEST_ANIMATED_LOOPED_PANNED_PLAYBACK)
260+
assert(!alIsEnabled(AL_SOURCE_DISTANCE_MODEL));
261+
alDisable(AL_SOURCE_DISTANCE_MODEL);
262+
assert(!alIsEnabled(AL_SOURCE_DISTANCE_MODEL));
263+
alEnable(AL_SOURCE_DISTANCE_MODEL);
264+
assert(alIsEnabled(AL_SOURCE_DISTANCE_MODEL));
260265
printf("You should hear a continuously looping clip of the 1902 piano song \"The Entertainer\" smoothly panning around the listener. Press OK when confirmed.\n");
261266
#elif defined(TEST_ANIMATED_LOOPED_RELATIVE_PLAYBACK)
262267
alSourcei(sources[0], AL_SOURCE_RELATIVE, AL_TRUE);

0 commit comments

Comments
 (0)