버전

menu_open
Wwise SDK 2023.1.3
JavaScript, Node.js - WAMP

Initializing the project

참고: This example requires the most recent Node.js LTS to be installed.

예제 디렉터리 <Wwise installation path>/SDK/samples/WwiseAuthoringAPI/js/hello-wwise-node-wamp에서 다음 명령을 실행해 연관된 라이브러리를 설치하세요.

npm install

프로젝트 코드

예제 디렉터리 hello-wwise-node-wamp의 예제 파일인 index.js는 Wwise Authoring API로 연결을 허용합니다.

var ak = require('../../../../include/AK/WwiseAuthoringAPI/js/waapi.js').ak;
var autobahn = require('autobahn');
// Create the WAMP connection
var connection = new autobahn.Connection({
url: 'ws://127.0.0.1:8080/waapi',
realm: 'realm1',
protocols: ['wamp.2.json']
});
// Setup handler for connection opened
connection.onopen = function (session) {
// Call getInfo
session.call(ak.wwise.core.getInfo, [], {}).then(
function (res) {
console.log(`Hello ${res.kwargs.displayName} ${res.kwargs.version.displayName}!`);
},
function (error) {
console.log(`Error: ${error}`);
}
).then(
function() {
connection.close();
}
);
};
connection.onclose = function (reason, details) {
if (reason !== 'lost') {
console.log("Connection closed. Reason: " + reason);
}
process.exit();
};
// Open the connection
connection.open();

참고: var ak = require('../../../../include/AK/WwiseAuthoringAPI/js/waapi.js').ak 라인은 API 경로 선언을 가져옵니다.

이는 <Wwise installation path>/SDK/include/AK/WwiseAuthoringAPI/js에 있습니다.

이 예제에서는 이 파일에 대한 경로가 예제의 위치에 대해 상대적입니다.

프로젝트 실행하기

예제의 디렉터리에서 다음 명령을 실행하세요.

node index.js

Wwise Authoring API가 Wwise에 성공적으로 연결되면 다음 출력이 뜹니다.

Hello Wwise 20??.?.?

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요