Skip to content

Commit 7fb6ddf

Browse files
committed
Shortened property names
1 parent bf3ccdb commit 7fb6ddf

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/audio_worklet.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,19 @@ class BootstrapMessages extends AudioWorkletProcessor {
168168
}
169169
#endif
170170
// Register a real AudioWorkletProcessor that will actually do audio processing.
171-
registerProcessor(d['_wpn'], createWasmAudioWorkletProcessor(d['audioParams']));
171+
// 'ap' being the audio params
172+
registerProcessor(d['_wpn'], createWasmAudioWorkletProcessor(d['ap']));
172173
#if WEBAUDIO_DEBUG
173-
console.log(`Registered a new WasmAudioWorkletProcessor "${d['_wpn']}" with AudioParams: ${d['audioParams']}`);
174+
console.log(`Registered a new WasmAudioWorkletProcessor "${d['_wpn']}" with AudioParams: ${d['ap']}`);
174175
#endif
175176
// Post a Wasm Call message back telling that we have now registered the
176177
// AudioWorkletProcessor class, and should trigger the user onSuccess
177178
// callback of the
178179
// emscripten_create_wasm_audio_worklet_processor_async() call.
179-
p.postMessage({'_wsc': d['callback'], 'x': [d['contextHandle'], 1/*EM_TRUE*/, d['userData']] }); // "WaSm Call"
180+
// 'cb' is the callback function
181+
// 'ch' the context handle
182+
// 'ud' the passed user data
183+
p.postMessage({'_wsc': d['cb'], 'x': [d['ch'], 1/*EM_TRUE*/, d['ud']] }); // "WaSm Call"
180184
} else if (d['_wsc']) {
181185
// '_wsc' is short for 'wasm call', using an identifier that will never
182186
// conflict with user messages

src/library_webaudio.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,15 @@ let LibraryWebAudio = {
249249
#endif
250250

251251
EmAudio[contextHandle].audioWorklet.bootstrapMessage.port.postMessage({
252-
// '_wpn' == 'Worklet Processor Name', use a deliberately mangled name so
253-
// that this field won't accidentally be mixed with user submitted
254-
// messages.
252+
// Deliberately mangled and short names used here ('_wpn', the 'Worklet
253+
// Processor Name', to not get accidentally mixed with user submitted
254+
// messages, the remainder for space saving reasons, abbreviated from
255+
// their variable names).
255256
'_wpn': UTF8ToString(HEAPU32[options]),
256-
'audioParams': audioParams,
257-
'contextHandle': contextHandle,
258-
'callback': callback,
259-
'userData': userData
257+
'ap': audioParams,
258+
'ch': contextHandle,
259+
'cb': callback,
260+
'ud': userData
260261
});
261262
},
262263

0 commit comments

Comments
 (0)