sfml.js 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +10 -9
- package/README.ko.md +10 -9
- package/README.md +10 -9
- package/README.zh-CN.md +10 -9
- package/binding.gyp +23 -16
- package/dist/audio/effect-processor.js +9 -3
- package/dist/audio/input-sound-file.js +41 -15
- package/dist/audio/listener.js +33 -11
- package/dist/audio/music.js +41 -18
- package/dist/audio/output-sound-file.js +4 -2
- package/dist/audio/playback-device.js +11 -3
- package/dist/audio/sound-buffer-recorder.js +8 -5
- package/dist/audio/sound-buffer.js +40 -17
- package/dist/audio/sound-file-factory.js +21 -9
- package/dist/audio/sound-file-reader.js +21 -7
- package/dist/audio/sound-recorder.js +36 -15
- package/dist/audio/sound-source.js +117 -40
- package/dist/audio/sound-stream.js +14 -5
- package/dist/audio/sound.js +9 -4
- package/dist/audio/value.js +42 -16
- package/dist/graphics/blend-mode.js +2 -1
- package/dist/graphics/boolean-vector.d.ts +1 -2
- package/dist/graphics/boolean-vector.js +19 -9
- package/dist/graphics/color.js +2 -1
- package/dist/graphics/convex-shape.js +7 -3
- package/dist/graphics/font.js +52 -23
- package/dist/graphics/glsl-matrix.js +8 -3
- package/dist/graphics/glsl.js +47 -16
- package/dist/graphics/glyph.js +27 -10
- package/dist/graphics/image.js +30 -14
- package/dist/graphics/rect.js +15 -8
- package/dist/graphics/render-states.js +18 -9
- package/dist/graphics/render-target.js +49 -23
- package/dist/graphics/render-texture.js +24 -12
- package/dist/graphics/render-window.js +6 -3
- package/dist/graphics/shader.js +67 -32
- package/dist/graphics/shape.js +25 -13
- package/dist/graphics/sprite.js +19 -9
- package/dist/graphics/stencil-mode.js +10 -6
- package/dist/graphics/swap.js +2 -1
- package/dist/graphics/text.js +123 -48
- package/dist/graphics/texture.js +48 -24
- package/dist/graphics/transform.js +29 -13
- package/dist/graphics/transformable.js +2 -1
- package/dist/graphics/vertex-array.js +40 -18
- package/dist/graphics/vertex-buffer.js +39 -19
- package/dist/graphics/vertex.js +6 -3
- package/dist/graphics/view.js +30 -14
- package/dist/index.d.ts +4 -4
- package/dist/internal/audio-codec-registry.js +12 -6
- package/dist/internal/audio-input-stream.js +2 -1
- package/dist/internal/audio-music-pump.js +58 -24
- package/dist/internal/audio-recorder-session.js +17 -7
- package/dist/internal/audio-worker-session.js +28 -10
- package/dist/internal/audio-worker.js +40 -21
- package/dist/internal/glsl-value.d.ts +3 -1
- package/dist/internal/glsl-value.js +18 -8
- package/dist/internal/graphics-state.js +29 -15
- package/dist/internal/input-stream.d.ts +3 -1
- package/dist/internal/input-stream.js +16 -7
- package/dist/internal/numeric-properties.js +2 -1
- package/dist/internal/render-states.js +2 -1
- package/dist/internal/scalar.js +22 -13
- package/dist/internal/shaped-glyph.d.ts +3 -1
- package/dist/internal/shaped-glyph.js +12 -4
- package/dist/internal/struct-view.d.ts +3 -1
- package/dist/internal/struct-view.js +3 -1
- package/dist/internal/transformable.js +2 -1
- package/dist/network/common.js +23 -11
- package/dist/network/dns.js +25 -17
- package/dist/network/ftp.js +43 -18
- package/dist/network/http.js +126 -56
- package/dist/network/ip-address.js +50 -25
- package/dist/network/packet.js +63 -25
- package/dist/network/sftp.js +175 -74
- package/dist/network/socket-selector.js +28 -14
- package/dist/network/socket.js +71 -30
- package/dist/network/tcp-listener.js +42 -19
- package/dist/network/tcp-socket.js +111 -53
- package/dist/network/tls-material.js +2 -1
- package/dist/network/udp-socket.js +68 -33
- package/dist/system/angle.js +2 -1
- package/dist/system/clock.js +4 -2
- package/dist/system/err.js +5 -2
- package/dist/system/file-input-stream.js +8 -4
- package/dist/system/input-stream.js +6 -3
- package/dist/system/operators.d.ts +1 -1
- package/dist/system/operators.js +90 -50
- package/dist/system/sleep.js +4 -2
- package/dist/system/time.js +12 -6
- package/dist/system/vector2.js +6 -7
- package/dist/system/vector3.js +11 -6
- package/dist/window/clipboard.js +2 -1
- package/dist/window/context.js +10 -5
- package/dist/window/cursor.js +2 -1
- package/dist/window/event.js +9 -5
- package/dist/window/mouse.js +4 -2
- package/dist/window/video-mode.js +2 -1
- package/dist/window/window.js +19 -12
- package/native/addon.cc +25 -12
- package/native/audio-binding.cc +266 -126
- package/native/audio-codec-binding.cc +147 -77
- package/native/audio-device-binding.cc +76 -49
- package/native/audio-file-binding.cc +116 -67
- package/native/audio-recorder-binding.cc +147 -98
- package/native/audio-recorder.h +1 -1
- package/native/audio-state.h +53 -30
- package/native/audio-stream-binding.cc +148 -94
- package/native/audio-stream.h +5 -4
- package/native/audio-worker-binding.cc +163 -81
- package/native/audio-worker.h +35 -19
- package/native/batch-drawable.cc +29 -16
- package/native/batch-drawable.h +11 -8
- package/native/context-binding.cc +40 -27
- package/native/context-settings.h +15 -8
- package/native/deferred-delete.cc +9 -6
- package/native/deferred-delete.h +7 -8
- package/native/error-stream-binding.cc +42 -28
- package/native/font-binding.cc +89 -48
- package/native/graphics-binding.cc +122 -72
- package/native/graphics-state.h +50 -36
- package/native/image-binding.cc +38 -24
- package/native/image-state.h +26 -18
- package/native/input-binding.cc +42 -27
- package/native/render-window-binding.cc +38 -23
- package/native/shader-binding.cc +115 -50
- package/native/shape-binding.cc +94 -49
- package/native/shape-state.h +18 -9
- package/native/shaped-glyph-storage.h +9 -5
- package/native/stream-binding.cc +143 -117
- package/native/system-binding.cc +17 -12
- package/native/text-binding.cc +68 -35
- package/native/text-state.h +25 -18
- package/native/texture-binding.cc +42 -33
- package/native/texture-resource.h +20 -12
- package/native/time-value.h +3 -1
- package/native/transformable-binding.cc +12 -6
- package/native/transformable-state.h +6 -6
- package/native/value-binding.h +46 -28
- package/native/value-layout.h +10 -10
- package/native/values-binding.cc +29 -23
- package/native/vertex-binding.cc +18 -12
- package/native/vertex-buffer-binding.cc +38 -24
- package/native/vertex-storage.h +2 -2
- package/native/view-data.h +4 -3
- package/native/window-binding.cc +75 -45
- package/native/window-event.h +20 -11
- package/native/window-owner.h +15 -12
- package/package.json +44 -51
- package/src/audio/effect-processor.ts +9 -3
- package/src/audio/input-sound-file.ts +108 -36
- package/src/audio/listener.ts +39 -13
- package/src/audio/music.ts +112 -47
- package/src/audio/output-sound-file.ts +40 -11
- package/src/audio/playback-device.ts +23 -8
- package/src/audio/sound-buffer-recorder.ts +35 -13
- package/src/audio/sound-buffer.ts +166 -58
- package/src/audio/sound-file-factory.ts +127 -49
- package/src/audio/sound-file-reader.ts +49 -15
- package/src/audio/sound-recorder.ts +100 -34
- package/src/audio/sound-source.ts +142 -45
- package/src/audio/sound-stream.ts +15 -5
- package/src/audio/sound.ts +12 -4
- package/src/audio/value.ts +89 -26
- package/src/graphics/blend-mode.ts +3 -1
- package/src/graphics/boolean-vector.ts +56 -26
- package/src/graphics/color.ts +3 -1
- package/src/graphics/convex-shape.ts +10 -3
- package/src/graphics/font.ts +171 -50
- package/src/graphics/glsl-matrix.ts +9 -3
- package/src/graphics/glsl.ts +81 -35
- package/src/graphics/glyph.ts +67 -26
- package/src/graphics/image.ts +119 -45
- package/src/graphics/rect.ts +56 -24
- package/src/graphics/render-states.ts +31 -14
- package/src/graphics/render-target.ts +197 -81
- package/src/graphics/render-texture.ts +36 -12
- package/src/graphics/render-window.ts +9 -3
- package/src/graphics/shader.ts +186 -61
- package/src/graphics/shape.ts +93 -35
- package/src/graphics/sprite.ts +64 -25
- package/src/graphics/stencil-mode.ts +12 -6
- package/src/graphics/swap.ts +3 -2
- package/src/graphics/text.ts +229 -74
- package/src/graphics/texture.ts +180 -61
- package/src/graphics/transform.ts +132 -47
- package/src/graphics/transformable.ts +3 -1
- package/src/graphics/vertex-array.ts +87 -35
- package/src/graphics/vertex-buffer.ts +97 -33
- package/src/graphics/vertex.ts +9 -3
- package/src/graphics/view.ts +59 -21
- package/src/index.ts +101 -23
- package/src/internal/audio-codec-registry.ts +18 -6
- package/src/internal/audio-input-stream.ts +6 -2
- package/src/internal/audio-music-pump.ts +116 -41
- package/src/internal/audio-native.ts +249 -96
- package/src/internal/audio-recorder-session.ts +68 -24
- package/src/internal/audio-worker-session.ts +65 -21
- package/src/internal/audio-worker.ts +85 -41
- package/src/internal/glsl-value.ts +26 -11
- package/src/internal/graphics-state.ts +57 -20
- package/src/internal/input-stream.ts +23 -10
- package/src/internal/native.ts +252 -99
- package/src/internal/numeric-properties.ts +2 -1
- package/src/internal/render-states.ts +3 -1
- package/src/internal/scalar.ts +33 -14
- package/src/internal/shaped-glyph.ts +25 -12
- package/src/internal/struct-view.ts +40 -13
- package/src/internal/transformable.ts +3 -1
- package/src/network/common.ts +35 -11
- package/src/network/dns.ts +95 -38
- package/src/network/ftp.ts +129 -47
- package/src/network/http.ts +232 -77
- package/src/network/ip-address.ts +118 -48
- package/src/network/packet.ts +161 -54
- package/src/network/sftp.ts +498 -168
- package/src/network/socket-selector.ts +66 -26
- package/src/network/socket.ts +133 -46
- package/src/network/tcp-listener.ts +78 -29
- package/src/network/tcp-socket.ts +240 -95
- package/src/network/tls-material.ts +6 -2
- package/src/network/udp-socket.ts +147 -53
- package/src/system/angle.ts +3 -1
- package/src/system/clock.ts +12 -4
- package/src/system/err.ts +5 -2
- package/src/system/file-input-stream.ts +12 -4
- package/src/system/input-stream.ts +9 -3
- package/src/system/operators.ts +290 -115
- package/src/system/sleep.ts +6 -2
- package/src/system/time.ts +18 -6
- package/src/system/timeout-with-predicate.ts +19 -8
- package/src/system/vector2.ts +101 -49
- package/src/system/vector3.ts +85 -36
- package/src/window/clipboard.ts +3 -1
- package/src/window/context.ts +15 -5
- package/src/window/cursor.ts +3 -1
- package/src/window/event.ts +26 -12
- package/src/window/mouse.ts +6 -2
- package/src/window/video-mode.ts +3 -1
- package/src/window/window.ts +119 -37
- package/test/native/audio-probes.cc +74 -36
- package/test/native/deferred-delete-probes.cc +17 -11
- package/test/native/drawable-probes.cc +70 -36
- package/test/native/exception-probes.cc +14 -9
- package/test/native/image-probes.cc +20 -10
- package/test/native/matrix-probes.cc +8 -4
- package/test/native/network-oracle.cc +17 -11
- package/test/native/render-texture-probes.cc +33 -24
- package/test/native/shader-probes.cc +9 -9
- package/test/native/shape-probes.cc +37 -23
- package/test/native/sprite-probes.cc +41 -25
- package/test/native/system-probes.cc +58 -35
- package/test/native/text-probes.cc +77 -44
- package/test/native/texture-probes.cc +43 -26
- package/test/native/time-probes.cc +18 -12
- package/test/native/transform-probes.cc +15 -10
- package/test/native/transformable-probes.cc +23 -17
- package/test/native/value-oracle.h +9 -4
- package/test/native/value-probes.cc +31 -23
- package/test/native/vertex-array-probes.cc +22 -14
- package/test/native/vertex-buffer-probes.cc +28 -17
- package/test/native/view-probes.cc +29 -17
- package/test/native/window-probes.cc +66 -33
- package/tools/ensure-sfml.cjs +9 -0
- package/tools/generate-network-constants.cjs +11 -6
- package/tools/generate-window-constants.cjs +31 -12
- package/docs/README.ja.md +0 -30
- package/docs/README.ko.md +0 -30
- package/docs/README.md +0 -30
- package/docs/README.zh-CN.md +0 -30
- package/docs/api.ja.md +0 -84
- package/docs/api.ko.md +0 -84
- package/docs/api.md +0 -81
- package/docs/api.zh-CN.md +0 -81
- package/docs/audio.ja.md +0 -249
- package/docs/audio.ko.md +0 -251
- package/docs/audio.md +0 -252
- package/docs/audio.zh-CN.md +0 -252
- package/docs/concepts.ja.md +0 -130
- package/docs/concepts.ko.md +0 -130
- package/docs/concepts.md +0 -131
- package/docs/concepts.zh-CN.md +0 -131
- package/docs/development.ja.md +0 -144
- package/docs/development.ko.md +0 -144
- package/docs/development.md +0 -146
- package/docs/development.zh-CN.md +0 -146
- package/docs/getting-started.ja.md +0 -154
- package/docs/getting-started.ko.md +0 -154
- package/docs/getting-started.md +0 -156
- package/docs/getting-started.zh-CN.md +0 -156
- package/docs/graphics.ja.md +0 -256
- package/docs/graphics.ko.md +0 -254
- package/docs/graphics.md +0 -255
- package/docs/graphics.zh-CN.md +0 -257
- package/docs/network.ja.md +0 -214
- package/docs/network.ko.md +0 -216
- package/docs/network.md +0 -218
- package/docs/network.zh-CN.md +0 -218
- package/docs/system.ja.md +0 -169
- package/docs/system.ko.md +0 -171
- package/docs/system.md +0 -173
- package/docs/system.zh-CN.md +0 -173
- package/docs/window.ja.md +0 -138
- package/docs/window.ko.md +0 -140
- package/docs/window.md +0 -141
- package/docs/window.zh-CN.md +0 -141
- package/native/exception-boundary.h +0 -97
- package/native/numeric-fields.h +0 -96
- package/native/shared-handle.h +0 -107
- package/test/tsconfig.json +0 -8
- package/tools/configure-lsp.cjs +0 -23
- package/tools/lib_downloader.cjs +0 -92
- package/tools/lib_downloader_urls.cjs +0 -23
|
@@ -68,28 +68,36 @@ class SoundRecorder {
|
|
|
68
68
|
* @ja システムが音声キャプチャに対応しているかどうかを返します。
|
|
69
69
|
* @ko 시스템의 오디오 캡처 지원 여부를 반환합니다.
|
|
70
70
|
*/
|
|
71
|
-
static isAvailable() {
|
|
71
|
+
static isAvailable() {
|
|
72
|
+
return audio_native_1.audioNative.audioCaptureDevices(2);
|
|
73
|
+
}
|
|
72
74
|
/**
|
|
73
75
|
* Return the current sample rate in Hz.
|
|
74
76
|
* @zh 返回当前采样率,单位为 Hz。
|
|
75
77
|
* @ja 現在のサンプルレートを Hz で返します。
|
|
76
78
|
* @ko 현재 샘플 레이트를 Hz 단위로 반환합니다.
|
|
77
79
|
*/
|
|
78
|
-
getSampleRate() {
|
|
80
|
+
getSampleRate() {
|
|
81
|
+
return this.values[0];
|
|
82
|
+
}
|
|
79
83
|
/**
|
|
80
84
|
* Return the number of capture channels.
|
|
81
85
|
* @zh 返回采集声道数。
|
|
82
86
|
* @ja キャプチャのチャンネル数を返します。
|
|
83
87
|
* @ko 캡처 채널 수를 반환합니다.
|
|
84
88
|
*/
|
|
85
|
-
getChannelCount() {
|
|
89
|
+
getChannelCount() {
|
|
90
|
+
return this.values[1];
|
|
91
|
+
}
|
|
86
92
|
/**
|
|
87
93
|
* Return the speaker position mapping of the capture channels.
|
|
88
94
|
* @zh 返回采集声道的扬声器位置映射。
|
|
89
95
|
* @ja キャプチャチャンネルのスピーカー位置マッピングを返します。
|
|
90
96
|
* @ko 캡처 채널의 스피커 위치 매핑을 반환합니다.
|
|
91
97
|
*/
|
|
92
|
-
getChannelMap() {
|
|
98
|
+
getChannelMap() {
|
|
99
|
+
return this.channelMap;
|
|
100
|
+
}
|
|
93
101
|
/**
|
|
94
102
|
* Return the current recording device name.
|
|
95
103
|
* @zh 返回当前录音设备名称。
|
|
@@ -154,8 +162,9 @@ class SoundRecorder {
|
|
|
154
162
|
}
|
|
155
163
|
const version = this.stopVersion;
|
|
156
164
|
return this.run(async () => {
|
|
157
|
-
if (this.values[2])
|
|
165
|
+
if (this.values[2]) {
|
|
158
166
|
return false;
|
|
167
|
+
}
|
|
159
168
|
if (this.directSession) {
|
|
160
169
|
await this.directSession.drain().catch(() => { });
|
|
161
170
|
cleanup.unregister(this);
|
|
@@ -170,8 +179,9 @@ class SoundRecorder {
|
|
|
170
179
|
cleanup.register(this, session, this);
|
|
171
180
|
try {
|
|
172
181
|
const ok = await session.ready;
|
|
173
|
-
if (!ok)
|
|
182
|
+
if (!ok) {
|
|
174
183
|
await session.drain();
|
|
184
|
+
}
|
|
175
185
|
return ok;
|
|
176
186
|
}
|
|
177
187
|
catch (error) {
|
|
@@ -181,20 +191,25 @@ class SoundRecorder {
|
|
|
181
191
|
}
|
|
182
192
|
if (mapping.handle && this.options) {
|
|
183
193
|
const weak = new WeakRef(this);
|
|
184
|
-
this.session = new audio_worker_session_1.AudioWorkerSession(mapping.handle, mapping.token, 'recorder', this.options, {
|
|
185
|
-
|
|
194
|
+
this.session = new audio_worker_session_1.AudioWorkerSession(mapping.handle, mapping.token, 'recorder', this.options, {
|
|
195
|
+
sampleRate,
|
|
196
|
+
channelCount: this.getChannelCount(),
|
|
197
|
+
blockFrames: frames,
|
|
198
|
+
}, () => {
|
|
186
199
|
const recorder = weak.deref();
|
|
187
|
-
if (recorder)
|
|
200
|
+
if (recorder) {
|
|
188
201
|
void recorder.stop().catch(() => { });
|
|
202
|
+
}
|
|
189
203
|
});
|
|
190
|
-
if (!await this.session.ready) {
|
|
204
|
+
if (!(await this.session.ready)) {
|
|
191
205
|
await this.session.close();
|
|
192
206
|
return false;
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
209
|
const ok = await (0, audio_native_1.audioAsync)(callback => audio_native_1.audioNative.startAudioRecorder(this[audio_native_1.audioHandle], callback));
|
|
196
|
-
if (!ok)
|
|
210
|
+
if (!ok) {
|
|
197
211
|
await this.session?.close();
|
|
212
|
+
}
|
|
198
213
|
return ok;
|
|
199
214
|
});
|
|
200
215
|
}
|
|
@@ -218,8 +233,9 @@ class SoundRecorder {
|
|
|
218
233
|
stop() {
|
|
219
234
|
++this.stopVersion;
|
|
220
235
|
const current = (0, audio_recorder_session_1.currentRecorderSession)(this[audio_native_1.audioHandle]);
|
|
221
|
-
if (current)
|
|
236
|
+
if (current) {
|
|
222
237
|
return current.requestStop();
|
|
238
|
+
}
|
|
223
239
|
// Cancel an onStart callback immediately, even while start owns the queue.
|
|
224
240
|
// @zh 即使 start 占用队列,也立即取消 onStart 回调。
|
|
225
241
|
// @ja start がキューを占有中でも、onStart コールバックを即座に取り消します。
|
|
@@ -231,8 +247,9 @@ class SoundRecorder {
|
|
|
231
247
|
return;
|
|
232
248
|
}
|
|
233
249
|
const buffer = await (0, audio_native_1.audioAsync)(callback => audio_native_1.audioNative.stopAudioRecorder(this[audio_native_1.audioHandle], callback));
|
|
234
|
-
if (buffer)
|
|
250
|
+
if (buffer) {
|
|
235
251
|
this.onBuffer(buffer);
|
|
252
|
+
}
|
|
236
253
|
await this.session?.drain();
|
|
237
254
|
});
|
|
238
255
|
}
|
|
@@ -277,10 +294,14 @@ class SoundRecorder {
|
|
|
277
294
|
* @ja 完成した Native 録音バッファーを受け取ります。
|
|
278
295
|
* @ko 완성된 Native 녹음 버퍼를 받습니다.
|
|
279
296
|
*/
|
|
280
|
-
onBuffer(buffer) {
|
|
297
|
+
onBuffer(buffer) {
|
|
298
|
+
void buffer;
|
|
299
|
+
}
|
|
281
300
|
run(action) {
|
|
282
301
|
++this.pendingOperations;
|
|
283
|
-
return this.queue.run(action).finally(() => {
|
|
302
|
+
return this.queue.run(action).finally(() => {
|
|
303
|
+
--this.pendingOperations;
|
|
304
|
+
});
|
|
284
305
|
}
|
|
285
306
|
}
|
|
286
307
|
exports.SoundRecorder = SoundRecorder;
|
|
@@ -29,8 +29,9 @@ class SoundSource {
|
|
|
29
29
|
if (!(source instanceof SoundSource)) {
|
|
30
30
|
throw new TypeError('Expected a SoundSource');
|
|
31
31
|
}
|
|
32
|
-
if (source === this)
|
|
32
|
+
if (source === this) {
|
|
33
33
|
return this;
|
|
34
|
+
}
|
|
34
35
|
audio_native_1.audioNative.assignAudioSource(this[audio_native_1.audioHandle], source[audio_native_1.audioHandle], false);
|
|
35
36
|
return this;
|
|
36
37
|
}
|
|
@@ -40,84 +41,108 @@ class SoundSource {
|
|
|
40
41
|
* @ja ピッチと再生速度の倍率を設定します。1 は元の速度です。
|
|
41
42
|
* @ko 음높이와 재생 속도 배율을 설정합니다. 1은 원래 속도입니다.
|
|
42
43
|
*/
|
|
43
|
-
setPitch(value) {
|
|
44
|
+
setPitch(value) {
|
|
45
|
+
this.set(0, value);
|
|
46
|
+
}
|
|
44
47
|
/**
|
|
45
48
|
* Return the pitch multiplier.
|
|
46
49
|
* @zh 返回音高倍率。
|
|
47
50
|
* @ja ピッチの倍率を返します。
|
|
48
51
|
* @ko 음높이 배율을 반환합니다.
|
|
49
52
|
*/
|
|
50
|
-
getPitch() {
|
|
53
|
+
getPitch() {
|
|
54
|
+
return this.get(0);
|
|
55
|
+
}
|
|
51
56
|
/**
|
|
52
57
|
* Set stereo pan: -1 is left, 0 is center, and 1 is right.
|
|
53
58
|
* @zh 设置立体声声像,-1 为左、0 为中、1 为右。
|
|
54
59
|
* @ja ステレオパンを設定します。-1 は左、0 は中央、1 は右です。
|
|
55
60
|
* @ko 스테레오 팬을 설정합니다. -1은 왼쪽, 0은 중앙, 1은 오른쪽입니다.
|
|
56
61
|
*/
|
|
57
|
-
setPan(value) {
|
|
62
|
+
setPan(value) {
|
|
63
|
+
this.set(1, value);
|
|
64
|
+
}
|
|
58
65
|
/**
|
|
59
66
|
* Return the stereo pan.
|
|
60
67
|
* @zh 返回立体声声像。
|
|
61
68
|
* @ja ステレオパンを返します。
|
|
62
69
|
* @ko 스테레오 팬을 반환합니다.
|
|
63
70
|
*/
|
|
64
|
-
getPan() {
|
|
71
|
+
getPan() {
|
|
72
|
+
return this.get(1);
|
|
73
|
+
}
|
|
65
74
|
/**
|
|
66
75
|
* Set volume as a percentage; 0 is silent and 100 is the original volume.
|
|
67
76
|
* @zh 设置音量百分比,0 为静音,100 为原始音量。
|
|
68
77
|
* @ja 音量を百分率で設定します。0 は無音、100 は元の音量です。
|
|
69
78
|
* @ko 볼륨을 백분율로 설정합니다. 0은 무음, 100은 원래 볼륨입니다.
|
|
70
79
|
*/
|
|
71
|
-
setVolume(value) {
|
|
80
|
+
setVolume(value) {
|
|
81
|
+
this.set(2, value);
|
|
82
|
+
}
|
|
72
83
|
/**
|
|
73
84
|
* Return the volume percentage.
|
|
74
85
|
* @zh 返回音量百分比。
|
|
75
86
|
* @ja 音量の百分率を返します。
|
|
76
87
|
* @ko 볼륨 백분율을 반환합니다.
|
|
77
88
|
*/
|
|
78
|
-
getVolume() {
|
|
89
|
+
getVolume() {
|
|
90
|
+
return this.get(2);
|
|
91
|
+
}
|
|
79
92
|
/**
|
|
80
93
|
* Enable or disable spatial effects from position, distance, and direction.
|
|
81
94
|
* @zh 设置是否启用位置、距离和方向引起的空间音效。
|
|
82
95
|
* @ja 位置・距離・方向による空間音響効果の有効・無効を設定します。
|
|
83
96
|
* @ko 위치, 거리, 방향에 따른 공간 음향 효과의 활성화 여부를 설정합니다.
|
|
84
97
|
*/
|
|
85
|
-
setSpatializationEnabled(value) {
|
|
98
|
+
setSpatializationEnabled(value) {
|
|
99
|
+
this.set(3, (0, value_1.flag)(value));
|
|
100
|
+
}
|
|
86
101
|
/**
|
|
87
102
|
* Return whether spatialization is enabled.
|
|
88
103
|
* @zh 返回是否启用空间音效。
|
|
89
104
|
* @ja 空間音響効果が有効かどうかを返します。
|
|
90
105
|
* @ko 공간 음향 효과의 활성화 여부를 반환합니다.
|
|
91
106
|
*/
|
|
92
|
-
isSpatializationEnabled() {
|
|
107
|
+
isSpatializationEnabled() {
|
|
108
|
+
return this.get(3) !== 0;
|
|
109
|
+
}
|
|
93
110
|
/**
|
|
94
111
|
* Set the 3D position using the same units as the listener and distances.
|
|
95
112
|
* @zh 设置三维位置,单位须与监听者位置及距离参数一致。
|
|
96
113
|
* @ja 3D 位置を設定します。単位はリスナー位置と距離パラメーターに合わせます。
|
|
97
114
|
* @ko 3차원 위치를 설정합니다. 리스너 위치 및 거리 매개변수와 단위가 같아야 합니다.
|
|
98
115
|
*/
|
|
99
|
-
setPosition(value) {
|
|
116
|
+
setPosition(value) {
|
|
117
|
+
this.setVector(4, value);
|
|
118
|
+
}
|
|
100
119
|
/**
|
|
101
120
|
* Return a copy of the 3D position.
|
|
102
121
|
* @zh 返回三维位置副本。
|
|
103
122
|
* @ja 3D 位置のコピーを返します。
|
|
104
123
|
* @ko 3차원 위치의 복사본을 반환합니다.
|
|
105
124
|
*/
|
|
106
|
-
getPosition() {
|
|
125
|
+
getPosition() {
|
|
126
|
+
return this.getVector(4);
|
|
127
|
+
}
|
|
107
128
|
/**
|
|
108
129
|
* Set the sound source's emission direction.
|
|
109
130
|
* @zh 设置声源发声方向。
|
|
110
131
|
* @ja 音源の発音方向を設定します。
|
|
111
132
|
* @ko 음원의 소리 방출 방향을 설정합니다.
|
|
112
133
|
*/
|
|
113
|
-
setDirection(value) {
|
|
134
|
+
setDirection(value) {
|
|
135
|
+
this.setVector(7, value);
|
|
136
|
+
}
|
|
114
137
|
/**
|
|
115
138
|
* Return a copy of the emission direction.
|
|
116
139
|
* @zh 返回发声方向副本。
|
|
117
140
|
* @ja 発音方向のコピーを返します。
|
|
118
141
|
* @ko 소리 방출 방향의 복사본을 반환합니다.
|
|
119
142
|
*/
|
|
120
|
-
getDirection() {
|
|
143
|
+
getDirection() {
|
|
144
|
+
return this.getVector(7);
|
|
145
|
+
}
|
|
121
146
|
/**
|
|
122
147
|
* Set the inner and outer cone angles and outer gain, updating the native
|
|
123
148
|
* audio engine.
|
|
@@ -141,8 +166,11 @@ class SoundSource {
|
|
|
141
166
|
*/
|
|
142
167
|
getCone() {
|
|
143
168
|
this.field(10, false);
|
|
144
|
-
return new value_1.Cone({
|
|
145
|
-
|
|
169
|
+
return new value_1.Cone({
|
|
170
|
+
innerAngle: (0, angle_1.radians)(this.values[10]),
|
|
171
|
+
outerAngle: (0, angle_1.radians)(this.values[11]),
|
|
172
|
+
outerGain: this.values[12],
|
|
173
|
+
});
|
|
146
174
|
}
|
|
147
175
|
/**
|
|
148
176
|
* Set the 3D velocity for the Doppler effect, in position units per second.
|
|
@@ -150,42 +178,54 @@ class SoundSource {
|
|
|
150
178
|
* @ja ドップラー効果用の 3D 速度を設定します。単位は位置単位/秒です。
|
|
151
179
|
* @ko 도플러 효과에 사용할 3차원 속도를 설정합니다. 단위는 위치 단위/초입니다.
|
|
152
180
|
*/
|
|
153
|
-
setVelocity(value) {
|
|
181
|
+
setVelocity(value) {
|
|
182
|
+
this.setVector(13, value);
|
|
183
|
+
}
|
|
154
184
|
/**
|
|
155
185
|
* Return a copy of the velocity.
|
|
156
186
|
* @zh 返回速度副本。
|
|
157
187
|
* @ja 速度のコピーを返します。
|
|
158
188
|
* @ko 속도의 복사본을 반환합니다.
|
|
159
189
|
*/
|
|
160
|
-
getVelocity() {
|
|
190
|
+
getVelocity() {
|
|
191
|
+
return this.getVector(13);
|
|
192
|
+
}
|
|
161
193
|
/**
|
|
162
194
|
* Set the Doppler effect multiplier; 0 disables it.
|
|
163
195
|
* @zh 设置多普勒效应倍率,0 禁用。
|
|
164
196
|
* @ja ドップラー効果の倍率を設定します。0 で無効になります。
|
|
165
197
|
* @ko 도플러 효과 배율을 설정합니다. 0은 비활성화합니다.
|
|
166
198
|
*/
|
|
167
|
-
setDopplerFactor(value) {
|
|
199
|
+
setDopplerFactor(value) {
|
|
200
|
+
this.set(16, value);
|
|
201
|
+
}
|
|
168
202
|
/**
|
|
169
203
|
* Return the Doppler effect multiplier.
|
|
170
204
|
* @zh 返回多普勒效应倍率。
|
|
171
205
|
* @ja ドップラー効果の倍率を返します。
|
|
172
206
|
* @ko 도플러 효과 배율을 반환합니다.
|
|
173
207
|
*/
|
|
174
|
-
getDopplerFactor() {
|
|
208
|
+
getDopplerFactor() {
|
|
209
|
+
return this.get(16);
|
|
210
|
+
}
|
|
175
211
|
/**
|
|
176
212
|
* Set the factor controlling the source direction's effect on attenuation.
|
|
177
213
|
* @zh 设置声源方向对衰减的影响因子。
|
|
178
214
|
* @ja 音源の方向が減衰に与える影響の係数を設定します。
|
|
179
215
|
* @ko 음원 방향이 감쇠에 미치는 영향 계수를 설정합니다.
|
|
180
216
|
*/
|
|
181
|
-
setDirectionalAttenuationFactor(value) {
|
|
217
|
+
setDirectionalAttenuationFactor(value) {
|
|
218
|
+
this.set(17, value);
|
|
219
|
+
}
|
|
182
220
|
/**
|
|
183
221
|
* Return the directional attenuation factor.
|
|
184
222
|
* @zh 返回方向衰减因子。
|
|
185
223
|
* @ja 指向性減衰係数を返します。
|
|
186
224
|
* @ko 지향성 감쇠 계수를 반환합니다.
|
|
187
225
|
*/
|
|
188
|
-
getDirectionalAttenuationFactor() {
|
|
226
|
+
getDirectionalAttenuationFactor() {
|
|
227
|
+
return this.get(17);
|
|
228
|
+
}
|
|
189
229
|
/**
|
|
190
230
|
* Set whether the position is relative to the listener; false uses world
|
|
191
231
|
* coordinates.
|
|
@@ -193,105 +233,135 @@ class SoundSource {
|
|
|
193
233
|
* @ja 位置をリスナー相対にするか設定します。false はワールド座標を使います。
|
|
194
234
|
* @ko 리스너 기준 상대 위치 여부를 설정합니다. false는 월드 좌표를 사용합니다.
|
|
195
235
|
*/
|
|
196
|
-
setRelativeToListener(value) {
|
|
236
|
+
setRelativeToListener(value) {
|
|
237
|
+
this.set(18, (0, value_1.flag)(value));
|
|
238
|
+
}
|
|
197
239
|
/**
|
|
198
240
|
* Return whether listener-relative coordinates are used.
|
|
199
241
|
* @zh 返回是否使用监听者相对坐标。
|
|
200
242
|
* @ja リスナー相対座標を使うかどうかを返します。
|
|
201
243
|
* @ko 리스너 기준 상대 좌표 사용 여부를 반환합니다.
|
|
202
244
|
*/
|
|
203
|
-
isRelativeToListener() {
|
|
245
|
+
isRelativeToListener() {
|
|
246
|
+
return this.get(18) !== 0;
|
|
247
|
+
}
|
|
204
248
|
/**
|
|
205
249
|
* Set the minimum reference distance at which maximum volume is maintained.
|
|
206
250
|
* @zh 设置保持最大音量的最小参考距离。
|
|
207
251
|
* @ja 最大音量を維持する最小基準距離を設定します。
|
|
208
252
|
* @ko 최대 볼륨을 유지하는 최소 기준 거리를 설정합니다.
|
|
209
253
|
*/
|
|
210
|
-
setMinDistance(value) {
|
|
254
|
+
setMinDistance(value) {
|
|
255
|
+
this.set(19, value);
|
|
256
|
+
}
|
|
211
257
|
/**
|
|
212
258
|
* Return the minimum reference distance.
|
|
213
259
|
* @zh 返回最小参考距离。
|
|
214
260
|
* @ja 最小基準距離を返します。
|
|
215
261
|
* @ko 최소 기준 거리를 반환합니다.
|
|
216
262
|
*/
|
|
217
|
-
getMinDistance() {
|
|
263
|
+
getMinDistance() {
|
|
264
|
+
return this.get(19);
|
|
265
|
+
}
|
|
218
266
|
/**
|
|
219
267
|
* Set the maximum distance used for distance attenuation.
|
|
220
268
|
* @zh 设置距离衰减使用的最大距离。
|
|
221
269
|
* @ja 距離減衰に使う最大距離を設定します。
|
|
222
270
|
* @ko 거리 감쇠에 사용할 최대 거리를 설정합니다.
|
|
223
271
|
*/
|
|
224
|
-
setMaxDistance(value) {
|
|
272
|
+
setMaxDistance(value) {
|
|
273
|
+
this.set(20, value);
|
|
274
|
+
}
|
|
225
275
|
/**
|
|
226
276
|
* Return the maximum distance.
|
|
227
277
|
* @zh 返回最大距离。
|
|
228
278
|
* @ja 最大距離を返します。
|
|
229
279
|
* @ko 최대 거리를 반환합니다.
|
|
230
280
|
*/
|
|
231
|
-
getMaxDistance() {
|
|
281
|
+
getMaxDistance() {
|
|
282
|
+
return this.get(20);
|
|
283
|
+
}
|
|
232
284
|
/**
|
|
233
285
|
* Set the minimum gain after distance attenuation.
|
|
234
286
|
* @zh 设置距离衰减后的最小增益。
|
|
235
287
|
* @ja 距離減衰後の最小ゲインを設定します。
|
|
236
288
|
* @ko 거리 감쇠 후의 최소 게인을 설정합니다.
|
|
237
289
|
*/
|
|
238
|
-
setMinGain(value) {
|
|
290
|
+
setMinGain(value) {
|
|
291
|
+
this.set(21, value);
|
|
292
|
+
}
|
|
239
293
|
/**
|
|
240
294
|
* Return the minimum gain.
|
|
241
295
|
* @zh 返回最小增益。
|
|
242
296
|
* @ja 最小ゲインを返します。
|
|
243
297
|
* @ko 최소 게인을 반환합니다.
|
|
244
298
|
*/
|
|
245
|
-
getMinGain() {
|
|
299
|
+
getMinGain() {
|
|
300
|
+
return this.get(21);
|
|
301
|
+
}
|
|
246
302
|
/**
|
|
247
303
|
* Set the maximum gain after distance attenuation.
|
|
248
304
|
* @zh 设置距离衰减后的最大增益。
|
|
249
305
|
* @ja 距離減衰後の最大ゲインを設定します。
|
|
250
306
|
* @ko 거리 감쇠 후의 최대 게인을 설정합니다.
|
|
251
307
|
*/
|
|
252
|
-
setMaxGain(value) {
|
|
308
|
+
setMaxGain(value) {
|
|
309
|
+
this.set(22, value);
|
|
310
|
+
}
|
|
253
311
|
/**
|
|
254
312
|
* Return the maximum gain.
|
|
255
313
|
* @zh 返回最大增益。
|
|
256
314
|
* @ja 最大ゲインを返します。
|
|
257
315
|
* @ko 최대 게인을 반환합니다.
|
|
258
316
|
*/
|
|
259
|
-
getMaxGain() {
|
|
317
|
+
getMaxGain() {
|
|
318
|
+
return this.get(22);
|
|
319
|
+
}
|
|
260
320
|
/**
|
|
261
321
|
* Set the distance attenuation factor; 0 disables distance attenuation.
|
|
262
322
|
* @zh 设置距离衰减因子,0 禁用距离衰减。
|
|
263
323
|
* @ja 距離減衰係数を設定します。0 で距離減衰が無効になります。
|
|
264
324
|
* @ko 거리 감쇠 계수를 설정합니다. 0은 거리 감쇠를 비활성화합니다.
|
|
265
325
|
*/
|
|
266
|
-
setAttenuation(value) {
|
|
326
|
+
setAttenuation(value) {
|
|
327
|
+
this.set(23, value);
|
|
328
|
+
}
|
|
267
329
|
/**
|
|
268
330
|
* Return the distance attenuation factor.
|
|
269
331
|
* @zh 返回距离衰减因子。
|
|
270
332
|
* @ja 距離減衰係数を返します。
|
|
271
333
|
* @ko 거리 감쇠 계수를 반환합니다.
|
|
272
334
|
*/
|
|
273
|
-
getAttenuation() {
|
|
335
|
+
getAttenuation() {
|
|
336
|
+
return this.get(23);
|
|
337
|
+
}
|
|
274
338
|
/**
|
|
275
339
|
* Set whether playback loops after reaching the end.
|
|
276
340
|
* @zh 设置到达末尾后是否循环播放。
|
|
277
341
|
* @ja 末尾に達した後にループ再生するか設定します。
|
|
278
342
|
* @ko 끝에 도달한 후 반복 재생할지 설정합니다.
|
|
279
343
|
*/
|
|
280
|
-
setLooping(value) {
|
|
344
|
+
setLooping(value) {
|
|
345
|
+
this.set(24, (0, value_1.flag)(value));
|
|
346
|
+
}
|
|
281
347
|
/**
|
|
282
348
|
* Return whether playback loops.
|
|
283
349
|
* @zh 返回是否循环播放。
|
|
284
350
|
* @ja ループ再生するかどうかを返します。
|
|
285
351
|
* @ko 반복 재생 여부를 반환합니다.
|
|
286
352
|
*/
|
|
287
|
-
isLooping() {
|
|
353
|
+
isLooping() {
|
|
354
|
+
return this.get(24) !== 0;
|
|
355
|
+
}
|
|
288
356
|
/**
|
|
289
357
|
* Query the native engine's current playback status.
|
|
290
358
|
* @zh 查询原生引擎的当前播放状态。
|
|
291
359
|
* @ja ネイティブエンジンの現在の再生状態を取得します。
|
|
292
360
|
* @ko 네이티브 엔진의 현재 재생 상태를 조회합니다.
|
|
293
361
|
*/
|
|
294
|
-
getStatus() {
|
|
362
|
+
getStatus() {
|
|
363
|
+
return this.get(25);
|
|
364
|
+
}
|
|
295
365
|
/**
|
|
296
366
|
* Bind and retain an effect processor reference; undefined removes it.
|
|
297
367
|
* @zh 绑定并保留效果处理器引用;undefined 移除处理器。
|
|
@@ -299,7 +369,8 @@ class SoundSource {
|
|
|
299
369
|
* @ko 효과 처리기를 연결하고 참조를 유지합니다. undefined는 처리기를 제거합니다.
|
|
300
370
|
*/
|
|
301
371
|
setEffectProcessor(processor) {
|
|
302
|
-
if (processor !== undefined &&
|
|
372
|
+
if (processor !== undefined &&
|
|
373
|
+
!(processor instanceof effect_processor_1.EffectProcessor)) {
|
|
303
374
|
throw new TypeError('Expected an EffectProcessor');
|
|
304
375
|
}
|
|
305
376
|
audio_native_1.audioNative.setAudioEffect(this[audio_native_1.audioHandle], processor?.[audio_native_1.audioHandle]);
|
|
@@ -311,21 +382,27 @@ class SoundSource {
|
|
|
311
382
|
* @ja 再生を開始または再開します。再生中なら SFML の仕様に従い最初から再生します。
|
|
312
383
|
* @ko 재생을 시작하거나 재개합니다. 이미 재생 중이면 SFML 동작에 따라 다시 시작합니다.
|
|
313
384
|
*/
|
|
314
|
-
play() {
|
|
385
|
+
play() {
|
|
386
|
+
this.command(0);
|
|
387
|
+
}
|
|
315
388
|
/**
|
|
316
389
|
* Pause and retain the playback position.
|
|
317
390
|
* @zh 暂停并保留播放位置。
|
|
318
391
|
* @ja 再生位置を保持して一時停止します。
|
|
319
392
|
* @ko 재생 위치를 유지한 채 일시 정지합니다.
|
|
320
393
|
*/
|
|
321
|
-
pause() {
|
|
394
|
+
pause() {
|
|
395
|
+
this.command(1);
|
|
396
|
+
}
|
|
322
397
|
/**
|
|
323
398
|
* Stop and reset the playback position to zero.
|
|
324
399
|
* @zh 停止并将播放位置归零。
|
|
325
400
|
* @ja 停止して再生位置をゼロに戻します。
|
|
326
401
|
* @ko 정지하고 재생 위치를 0으로 되돌립니다.
|
|
327
402
|
*/
|
|
328
|
-
stop() {
|
|
403
|
+
stop() {
|
|
404
|
+
this.command(2);
|
|
405
|
+
}
|
|
329
406
|
/**
|
|
330
407
|
* Set the playback time relative to the beginning of the sound.
|
|
331
408
|
* @zh 设置相对于声音起点的播放时间。
|
|
@@ -19,8 +19,9 @@ class SoundStream extends sound_source_1.SoundSource {
|
|
|
19
19
|
const map = options ? (0, value_1.channels)(options.channelMap) : new Int32Array(0);
|
|
20
20
|
const created = options ? audio_native_1.audioNative.createAudioStream(frames, (0, value_1.unsigned)(options.channelCount), (0, value_1.unsigned)(options.sampleRate), slots, map)
|
|
21
21
|
: undefined;
|
|
22
|
-
if (!created && !mapping)
|
|
22
|
+
if (!created && !mapping) {
|
|
23
23
|
throw new TypeError('Expected stream options');
|
|
24
|
+
}
|
|
24
25
|
super(created ?? mapping);
|
|
25
26
|
this.streamChannels = new Int32Array(audio_native_1.audioNative.audioSourceChannels(this[audio_native_1.audioHandle]));
|
|
26
27
|
if (created && options) {
|
|
@@ -35,28 +36,36 @@ class SoundStream extends sound_source_1.SoundSource {
|
|
|
35
36
|
* @ja チャンネルごとのサンプルレートを Hz で返します。
|
|
36
37
|
* @ko 채널별 샘플 레이트를 Hz 단위로 반환합니다.
|
|
37
38
|
*/
|
|
38
|
-
getSampleRate() {
|
|
39
|
+
getSampleRate() {
|
|
40
|
+
return this.get(26);
|
|
41
|
+
}
|
|
39
42
|
/**
|
|
40
43
|
* Return the number of channels.
|
|
41
44
|
* @zh 返回声道数量。
|
|
42
45
|
* @ja チャンネル数を返します。
|
|
43
46
|
* @ko 채널 수를 반환합니다.
|
|
44
47
|
*/
|
|
45
|
-
getChannelCount() {
|
|
48
|
+
getChannelCount() {
|
|
49
|
+
return this.get(27);
|
|
50
|
+
}
|
|
46
51
|
/**
|
|
47
52
|
* Return the speaker positions of the interleaved channels.
|
|
48
53
|
* @zh 返回各交错声道的扬声器位置。
|
|
49
54
|
* @ja 各インターリーブチャンネルのスピーカー位置を返します。
|
|
50
55
|
* @ko 각 인터리브 채널의 스피커 위치를 반환합니다.
|
|
51
56
|
*/
|
|
52
|
-
getChannelMap() {
|
|
57
|
+
getChannelMap() {
|
|
58
|
+
return this.streamChannels;
|
|
59
|
+
}
|
|
53
60
|
/**
|
|
54
61
|
* Return the Worker error, or undefined if no error has occurred.
|
|
55
62
|
* @zh 返回 Worker 错误;尚无错误时为 undefined。
|
|
56
63
|
* @ja Worker のエラーを返します。まだエラーがなければ undefined。
|
|
57
64
|
* @ko Worker 오류를 반환합니다. 아직 오류가 없으면 undefined입니다.
|
|
58
65
|
*/
|
|
59
|
-
getWorkerError() {
|
|
66
|
+
getWorkerError() {
|
|
67
|
+
return this.session?.error;
|
|
68
|
+
}
|
|
60
69
|
/**
|
|
61
70
|
* Return audio queue statistics, or undefined if there is no Worker session.
|
|
62
71
|
* @zh 返回音频队列统计;没有 Worker 会话时为 undefined。
|
package/dist/audio/sound.js
CHANGED
|
@@ -35,10 +35,12 @@ class Sound extends sound_source_1.SoundSource {
|
|
|
35
35
|
* @ko 속성과 버퍼 연결을 복사하고 현재 Sound를 정지하여 재생 위치를 처음으로 되돌립니다.
|
|
36
36
|
*/
|
|
37
37
|
assign(source) {
|
|
38
|
-
if (!(source instanceof Sound))
|
|
38
|
+
if (!(source instanceof Sound)) {
|
|
39
39
|
throw new TypeError('Expected a Sound');
|
|
40
|
-
|
|
40
|
+
}
|
|
41
|
+
if (source === this) {
|
|
41
42
|
return this;
|
|
43
|
+
}
|
|
42
44
|
audio_native_1.audioNative.assignAudioSource(this[audio_native_1.audioHandle], source[audio_native_1.audioHandle], true);
|
|
43
45
|
this.buffer = source.buffer;
|
|
44
46
|
return this;
|
|
@@ -50,8 +52,9 @@ class Sound extends sound_source_1.SoundSource {
|
|
|
50
52
|
* @ko 오디오 버퍼 참조를 교체하여 유지하고 네이티브 재생 음원을 갱신합니다.
|
|
51
53
|
*/
|
|
52
54
|
setBuffer(buffer) {
|
|
53
|
-
if (!(buffer instanceof sound_buffer_1.SoundBuffer))
|
|
55
|
+
if (!(buffer instanceof sound_buffer_1.SoundBuffer)) {
|
|
54
56
|
throw new TypeError('Expected a SoundBuffer');
|
|
57
|
+
}
|
|
55
58
|
audio_native_1.audioNative.setAudioBuffer(this[audio_native_1.audioHandle], buffer[audio_native_1.audioHandle]);
|
|
56
59
|
this.buffer = buffer;
|
|
57
60
|
}
|
|
@@ -61,6 +64,8 @@ class Sound extends sound_source_1.SoundSource {
|
|
|
61
64
|
* @ja 現在関連付けられているバッファーの読み取り専用参照を返します。
|
|
62
65
|
* @ko 현재 연결된 버퍼의 읽기 전용 참조를 반환합니다.
|
|
63
66
|
*/
|
|
64
|
-
getBuffer() {
|
|
67
|
+
getBuffer() {
|
|
68
|
+
return this.buffer;
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
exports.Sound = Sound;
|