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.
Files changed (314) hide show
  1. package/README.ja.md +16 -11
  2. package/README.ko.md +16 -11
  3. package/README.md +16 -11
  4. package/README.zh-CN.md +16 -11
  5. package/assets/breakout.png +0 -0
  6. package/binding.gyp +23 -16
  7. package/dist/audio/effect-processor.js +9 -3
  8. package/dist/audio/input-sound-file.js +41 -15
  9. package/dist/audio/listener.js +33 -11
  10. package/dist/audio/music.js +41 -18
  11. package/dist/audio/output-sound-file.js +4 -2
  12. package/dist/audio/playback-device.js +11 -3
  13. package/dist/audio/sound-buffer-recorder.js +8 -5
  14. package/dist/audio/sound-buffer.js +40 -17
  15. package/dist/audio/sound-file-factory.js +21 -9
  16. package/dist/audio/sound-file-reader.js +21 -7
  17. package/dist/audio/sound-recorder.js +36 -15
  18. package/dist/audio/sound-source.js +117 -40
  19. package/dist/audio/sound-stream.js +14 -5
  20. package/dist/audio/sound.js +9 -4
  21. package/dist/audio/value.js +42 -16
  22. package/dist/graphics/blend-mode.js +2 -1
  23. package/dist/graphics/boolean-vector.d.ts +1 -2
  24. package/dist/graphics/boolean-vector.js +19 -9
  25. package/dist/graphics/color.js +2 -1
  26. package/dist/graphics/convex-shape.js +7 -3
  27. package/dist/graphics/font.js +52 -23
  28. package/dist/graphics/glsl-matrix.js +8 -3
  29. package/dist/graphics/glsl.js +47 -16
  30. package/dist/graphics/glyph.js +27 -10
  31. package/dist/graphics/image.js +30 -14
  32. package/dist/graphics/rect.js +15 -8
  33. package/dist/graphics/render-states.js +18 -9
  34. package/dist/graphics/render-target.js +49 -23
  35. package/dist/graphics/render-texture.js +24 -12
  36. package/dist/graphics/render-window.js +6 -3
  37. package/dist/graphics/shader.js +67 -32
  38. package/dist/graphics/shape.js +25 -13
  39. package/dist/graphics/sprite.js +19 -9
  40. package/dist/graphics/stencil-mode.js +10 -6
  41. package/dist/graphics/swap.js +2 -1
  42. package/dist/graphics/text.js +123 -48
  43. package/dist/graphics/texture.js +48 -24
  44. package/dist/graphics/transform.js +29 -13
  45. package/dist/graphics/transformable.js +2 -1
  46. package/dist/graphics/vertex-array.js +40 -18
  47. package/dist/graphics/vertex-buffer.js +39 -19
  48. package/dist/graphics/vertex.js +6 -3
  49. package/dist/graphics/view.js +30 -14
  50. package/dist/index.d.ts +4 -4
  51. package/dist/internal/audio-codec-registry.js +12 -6
  52. package/dist/internal/audio-input-stream.js +2 -1
  53. package/dist/internal/audio-music-pump.js +58 -24
  54. package/dist/internal/audio-recorder-session.js +17 -7
  55. package/dist/internal/audio-worker-session.js +28 -10
  56. package/dist/internal/audio-worker.js +40 -21
  57. package/dist/internal/glsl-value.d.ts +3 -1
  58. package/dist/internal/glsl-value.js +18 -8
  59. package/dist/internal/graphics-state.js +29 -15
  60. package/dist/internal/input-stream.d.ts +3 -1
  61. package/dist/internal/input-stream.js +16 -7
  62. package/dist/internal/numeric-properties.js +2 -1
  63. package/dist/internal/render-states.js +2 -1
  64. package/dist/internal/scalar.js +22 -13
  65. package/dist/internal/shaped-glyph.d.ts +3 -1
  66. package/dist/internal/shaped-glyph.js +12 -4
  67. package/dist/internal/struct-view.d.ts +3 -1
  68. package/dist/internal/struct-view.js +3 -1
  69. package/dist/internal/transformable.js +2 -1
  70. package/dist/network/common.js +23 -11
  71. package/dist/network/dns.js +25 -17
  72. package/dist/network/ftp.js +43 -18
  73. package/dist/network/http.js +126 -56
  74. package/dist/network/ip-address.js +50 -25
  75. package/dist/network/packet.js +63 -25
  76. package/dist/network/sftp.js +175 -74
  77. package/dist/network/socket-selector.js +28 -14
  78. package/dist/network/socket.js +71 -30
  79. package/dist/network/tcp-listener.js +42 -19
  80. package/dist/network/tcp-socket.js +111 -53
  81. package/dist/network/tls-material.js +2 -1
  82. package/dist/network/udp-socket.js +68 -33
  83. package/dist/system/angle.js +2 -1
  84. package/dist/system/clock.js +4 -2
  85. package/dist/system/err.js +5 -2
  86. package/dist/system/file-input-stream.js +8 -4
  87. package/dist/system/input-stream.js +6 -3
  88. package/dist/system/operators.d.ts +1 -1
  89. package/dist/system/operators.js +90 -50
  90. package/dist/system/sleep.js +4 -2
  91. package/dist/system/time.js +12 -6
  92. package/dist/system/vector2.js +6 -7
  93. package/dist/system/vector3.js +11 -6
  94. package/dist/window/clipboard.js +2 -1
  95. package/dist/window/context.js +10 -5
  96. package/dist/window/cursor.js +2 -1
  97. package/dist/window/event.js +9 -5
  98. package/dist/window/mouse.js +4 -2
  99. package/dist/window/video-mode.js +2 -1
  100. package/dist/window/window.js +19 -12
  101. package/native/addon.cc +25 -12
  102. package/native/audio-binding.cc +266 -126
  103. package/native/audio-codec-binding.cc +147 -77
  104. package/native/audio-device-binding.cc +76 -49
  105. package/native/audio-file-binding.cc +116 -67
  106. package/native/audio-recorder-binding.cc +147 -98
  107. package/native/audio-recorder.h +1 -1
  108. package/native/audio-state.h +53 -30
  109. package/native/audio-stream-binding.cc +148 -94
  110. package/native/audio-stream.h +5 -4
  111. package/native/audio-worker-binding.cc +163 -81
  112. package/native/audio-worker.h +35 -19
  113. package/native/batch-drawable.cc +29 -16
  114. package/native/batch-drawable.h +11 -8
  115. package/native/context-binding.cc +40 -27
  116. package/native/context-settings.h +15 -8
  117. package/native/deferred-delete.cc +9 -6
  118. package/native/deferred-delete.h +7 -8
  119. package/native/error-stream-binding.cc +42 -28
  120. package/native/font-binding.cc +89 -48
  121. package/native/graphics-binding.cc +122 -72
  122. package/native/graphics-state.h +50 -36
  123. package/native/image-binding.cc +38 -24
  124. package/native/image-state.h +26 -18
  125. package/native/input-binding.cc +42 -27
  126. package/native/render-window-binding.cc +38 -23
  127. package/native/shader-binding.cc +115 -50
  128. package/native/shape-binding.cc +94 -49
  129. package/native/shape-state.h +18 -9
  130. package/native/shaped-glyph-storage.h +9 -5
  131. package/native/stream-binding.cc +143 -117
  132. package/native/system-binding.cc +17 -12
  133. package/native/text-binding.cc +68 -35
  134. package/native/text-state.h +25 -18
  135. package/native/texture-binding.cc +42 -33
  136. package/native/texture-resource.h +20 -12
  137. package/native/time-value.h +3 -1
  138. package/native/transformable-binding.cc +12 -6
  139. package/native/transformable-state.h +6 -6
  140. package/native/value-binding.h +46 -28
  141. package/native/value-layout.h +10 -10
  142. package/native/values-binding.cc +29 -23
  143. package/native/vertex-binding.cc +18 -12
  144. package/native/vertex-buffer-binding.cc +38 -24
  145. package/native/vertex-storage.h +2 -2
  146. package/native/view-data.h +4 -3
  147. package/native/window-binding.cc +75 -45
  148. package/native/window-event.h +20 -11
  149. package/native/window-owner.h +15 -12
  150. package/package.json +43 -50
  151. package/src/audio/effect-processor.ts +9 -3
  152. package/src/audio/input-sound-file.ts +108 -36
  153. package/src/audio/listener.ts +39 -13
  154. package/src/audio/music.ts +112 -47
  155. package/src/audio/output-sound-file.ts +40 -11
  156. package/src/audio/playback-device.ts +23 -8
  157. package/src/audio/sound-buffer-recorder.ts +35 -13
  158. package/src/audio/sound-buffer.ts +166 -58
  159. package/src/audio/sound-file-factory.ts +127 -49
  160. package/src/audio/sound-file-reader.ts +49 -15
  161. package/src/audio/sound-recorder.ts +100 -34
  162. package/src/audio/sound-source.ts +142 -45
  163. package/src/audio/sound-stream.ts +15 -5
  164. package/src/audio/sound.ts +12 -4
  165. package/src/audio/value.ts +89 -26
  166. package/src/graphics/blend-mode.ts +3 -1
  167. package/src/graphics/boolean-vector.ts +56 -26
  168. package/src/graphics/color.ts +3 -1
  169. package/src/graphics/convex-shape.ts +10 -3
  170. package/src/graphics/font.ts +171 -50
  171. package/src/graphics/glsl-matrix.ts +9 -3
  172. package/src/graphics/glsl.ts +81 -35
  173. package/src/graphics/glyph.ts +67 -26
  174. package/src/graphics/image.ts +119 -45
  175. package/src/graphics/rect.ts +56 -24
  176. package/src/graphics/render-states.ts +31 -14
  177. package/src/graphics/render-target.ts +197 -81
  178. package/src/graphics/render-texture.ts +36 -12
  179. package/src/graphics/render-window.ts +9 -3
  180. package/src/graphics/shader.ts +186 -61
  181. package/src/graphics/shape.ts +93 -35
  182. package/src/graphics/sprite.ts +64 -25
  183. package/src/graphics/stencil-mode.ts +12 -6
  184. package/src/graphics/swap.ts +3 -2
  185. package/src/graphics/text.ts +229 -74
  186. package/src/graphics/texture.ts +180 -61
  187. package/src/graphics/transform.ts +132 -47
  188. package/src/graphics/transformable.ts +3 -1
  189. package/src/graphics/vertex-array.ts +87 -35
  190. package/src/graphics/vertex-buffer.ts +97 -33
  191. package/src/graphics/vertex.ts +9 -3
  192. package/src/graphics/view.ts +59 -21
  193. package/src/index.ts +101 -23
  194. package/src/internal/audio-codec-registry.ts +18 -6
  195. package/src/internal/audio-input-stream.ts +6 -2
  196. package/src/internal/audio-music-pump.ts +116 -41
  197. package/src/internal/audio-native.ts +249 -96
  198. package/src/internal/audio-recorder-session.ts +68 -24
  199. package/src/internal/audio-worker-session.ts +65 -21
  200. package/src/internal/audio-worker.ts +85 -41
  201. package/src/internal/glsl-value.ts +26 -11
  202. package/src/internal/graphics-state.ts +57 -20
  203. package/src/internal/input-stream.ts +23 -10
  204. package/src/internal/native.ts +252 -99
  205. package/src/internal/numeric-properties.ts +2 -1
  206. package/src/internal/render-states.ts +3 -1
  207. package/src/internal/scalar.ts +33 -14
  208. package/src/internal/shaped-glyph.ts +25 -12
  209. package/src/internal/struct-view.ts +40 -13
  210. package/src/internal/transformable.ts +3 -1
  211. package/src/network/common.ts +35 -11
  212. package/src/network/dns.ts +95 -38
  213. package/src/network/ftp.ts +129 -47
  214. package/src/network/http.ts +232 -77
  215. package/src/network/ip-address.ts +118 -48
  216. package/src/network/packet.ts +161 -54
  217. package/src/network/sftp.ts +498 -168
  218. package/src/network/socket-selector.ts +66 -26
  219. package/src/network/socket.ts +133 -46
  220. package/src/network/tcp-listener.ts +78 -29
  221. package/src/network/tcp-socket.ts +240 -95
  222. package/src/network/tls-material.ts +6 -2
  223. package/src/network/udp-socket.ts +147 -53
  224. package/src/system/angle.ts +3 -1
  225. package/src/system/clock.ts +12 -4
  226. package/src/system/err.ts +5 -2
  227. package/src/system/file-input-stream.ts +12 -4
  228. package/src/system/input-stream.ts +9 -3
  229. package/src/system/operators.ts +290 -115
  230. package/src/system/sleep.ts +6 -2
  231. package/src/system/time.ts +18 -6
  232. package/src/system/timeout-with-predicate.ts +19 -8
  233. package/src/system/vector2.ts +101 -49
  234. package/src/system/vector3.ts +85 -36
  235. package/src/window/clipboard.ts +3 -1
  236. package/src/window/context.ts +15 -5
  237. package/src/window/cursor.ts +3 -1
  238. package/src/window/event.ts +26 -12
  239. package/src/window/mouse.ts +6 -2
  240. package/src/window/video-mode.ts +3 -1
  241. package/src/window/window.ts +119 -37
  242. package/test/native/audio-probes.cc +74 -36
  243. package/test/native/deferred-delete-probes.cc +17 -11
  244. package/test/native/drawable-probes.cc +70 -36
  245. package/test/native/exception-probes.cc +14 -9
  246. package/test/native/image-probes.cc +20 -10
  247. package/test/native/matrix-probes.cc +8 -4
  248. package/test/native/network-oracle.cc +17 -11
  249. package/test/native/render-texture-probes.cc +33 -24
  250. package/test/native/shader-probes.cc +9 -9
  251. package/test/native/shape-probes.cc +37 -23
  252. package/test/native/sprite-probes.cc +41 -25
  253. package/test/native/system-probes.cc +58 -35
  254. package/test/native/text-probes.cc +77 -44
  255. package/test/native/texture-probes.cc +43 -26
  256. package/test/native/time-probes.cc +18 -12
  257. package/test/native/transform-probes.cc +15 -10
  258. package/test/native/transformable-probes.cc +23 -17
  259. package/test/native/value-oracle.h +9 -4
  260. package/test/native/value-probes.cc +31 -23
  261. package/test/native/vertex-array-probes.cc +22 -14
  262. package/test/native/vertex-buffer-probes.cc +28 -17
  263. package/test/native/view-probes.cc +29 -17
  264. package/test/native/window-probes.cc +66 -33
  265. package/tools/ensure-sfml.cjs +9 -0
  266. package/tools/generate-network-constants.cjs +11 -6
  267. package/tools/generate-window-constants.cjs +31 -12
  268. package/docs/README.ja.md +0 -30
  269. package/docs/README.ko.md +0 -30
  270. package/docs/README.md +0 -30
  271. package/docs/README.zh-CN.md +0 -30
  272. package/docs/api.ja.md +0 -84
  273. package/docs/api.ko.md +0 -84
  274. package/docs/api.md +0 -81
  275. package/docs/api.zh-CN.md +0 -81
  276. package/docs/audio.ja.md +0 -249
  277. package/docs/audio.ko.md +0 -251
  278. package/docs/audio.md +0 -252
  279. package/docs/audio.zh-CN.md +0 -252
  280. package/docs/concepts.ja.md +0 -130
  281. package/docs/concepts.ko.md +0 -130
  282. package/docs/concepts.md +0 -131
  283. package/docs/concepts.zh-CN.md +0 -131
  284. package/docs/development.ja.md +0 -148
  285. package/docs/development.ko.md +0 -148
  286. package/docs/development.md +0 -150
  287. package/docs/development.zh-CN.md +0 -150
  288. package/docs/getting-started.ja.md +0 -154
  289. package/docs/getting-started.ko.md +0 -154
  290. package/docs/getting-started.md +0 -156
  291. package/docs/getting-started.zh-CN.md +0 -156
  292. package/docs/graphics.ja.md +0 -256
  293. package/docs/graphics.ko.md +0 -254
  294. package/docs/graphics.md +0 -255
  295. package/docs/graphics.zh-CN.md +0 -257
  296. package/docs/network.ja.md +0 -214
  297. package/docs/network.ko.md +0 -216
  298. package/docs/network.md +0 -218
  299. package/docs/network.zh-CN.md +0 -218
  300. package/docs/system.ja.md +0 -169
  301. package/docs/system.ko.md +0 -171
  302. package/docs/system.md +0 -173
  303. package/docs/system.zh-CN.md +0 -173
  304. package/docs/window.ja.md +0 -138
  305. package/docs/window.ko.md +0 -140
  306. package/docs/window.md +0 -141
  307. package/docs/window.zh-CN.md +0 -141
  308. package/native/exception-boundary.h +0 -97
  309. package/native/numeric-fields.h +0 -96
  310. package/native/shared-handle.h +0 -69
  311. package/test/tsconfig.json +0 -8
  312. package/tools/configure-lsp.cjs +0 -23
  313. package/tools/lib_downloader.cjs +0 -92
  314. 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() { return audio_native_1.audioNative.audioCaptureDevices(2); }
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() { return this.values[0]; }
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() { return this.values[1]; }
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() { return this.channelMap; }
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, { sampleRate,
185
- channelCount: this.getChannelCount(), blockFrames: frames }, () => {
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) { void buffer; }
297
+ onBuffer(buffer) {
298
+ void buffer;
299
+ }
281
300
  run(action) {
282
301
  ++this.pendingOperations;
283
- return this.queue.run(action).finally(() => { --this.pendingOperations; });
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) { this.set(0, 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() { return this.get(0); }
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) { this.set(1, 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() { return this.get(1); }
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) { this.set(2, 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() { return this.get(2); }
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) { this.set(3, (0, value_1.flag)(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() { return this.get(3) !== 0; }
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) { this.setVector(4, 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() { return this.getVector(4); }
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) { this.setVector(7, 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() { return this.getVector(7); }
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({ innerAngle: (0, angle_1.radians)(this.values[10]),
145
- outerAngle: (0, angle_1.radians)(this.values[11]), outerGain: this.values[12] });
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) { this.setVector(13, 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() { return this.getVector(13); }
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) { this.set(16, 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() { return this.get(16); }
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) { this.set(17, 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() { return this.get(17); }
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) { this.set(18, (0, value_1.flag)(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() { return this.get(18) !== 0; }
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) { this.set(19, 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() { return this.get(19); }
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) { this.set(20, 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() { return this.get(20); }
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) { this.set(21, 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() { return this.get(21); }
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) { this.set(22, 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() { return this.get(22); }
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) { this.set(23, 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() { return this.get(23); }
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) { this.set(24, (0, value_1.flag)(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() { return this.get(24) !== 0; }
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() { return this.get(25); }
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 && !(processor instanceof effect_processor_1.EffectProcessor)) {
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() { this.command(0); }
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() { this.command(1); }
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() { this.command(2); }
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() { return this.get(26); }
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() { return this.get(27); }
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() { return this.streamChannels; }
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() { return this.session?.error; }
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ใ€‚
@@ -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
- if (source === this)
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() { return this.buffer; }
67
+ getBuffer() {
68
+ return this.buffer;
69
+ }
65
70
  }
66
71
  exports.Sound = Sound;