sfml.js 1.0.0-rc.2 โ 1.1.0
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 +16 -11
- package/README.ko.md +16 -11
- package/README.md +16 -11
- package/README.zh-CN.md +16 -11
- package/assets/breakout.png +0 -0
- 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 +43 -50
- 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 -148
- package/docs/development.ko.md +0 -148
- package/docs/development.md +0 -150
- package/docs/development.zh-CN.md +0 -150
- 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 -69
- 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;
|