버전

menu_open
경고 : 이 페이지에서 보호된 일부 정보가 표시되지 않았습니다.
특정 플랫폼의 라이선스 사용자일 경우 로그인하셨는지 확인해 주세요.
Wwise SDK 2023.1.3
Integrating Wwise Motion

You can use Motion plug-ins to control the haptic feedback of a control interface. With Wwise, you can use the same set of tools to manage motion and audio in your application. Internally, motion data is no different than audio data, and all the features available for audio are also available for motion. Two types of haptic feedback are available through the motion feature: you can transform any audio signals in your project and into motion, or generate dedicated motion signals with the Motion source. You can test motion directly in Wwise Authoring on Windows with a supported controller.

Motion Components

Motion uses the Wwise Sound Engine plug-in system to work in an application, and can be subdivided into two modules: the audio source called Motion and the Audio Device called Wwise Motion. Although the Motion audio source is optional, it remains a powerful tool to create accurate and flexible motion designs.

Wwise Motion Audio Device Plug-in

The Wwise Motion audio device plug-in links the sound engine to motion-ready devices. Just like any audio device plug-in, it receives data from a set of Listeners and "presents" this data to a device. This plug-in is inside a separate library and needs to be included in both Wwise Authoring and the application. 더 많은 정보는 Setting Up Motion 섹션을 참고하세요.

Motion Source Plug-in

You can use the Motion source plug-in to design the behavior of haptic feedback effects. 다른 오디오 음원과 마찬가지로 자신의 Wwise 프로젝트에서 Sound SFX 노드에 Motion 소스 플러그인을 추가할 수 있습니다. Make sure that the Sound SFX nodes have Output Busses set to motion-ready busses. See Motion for more information.

Setting Up Motion

To use motion in your application, you need to properly set up each component. All the concepts applicable to the audio workflow are also applicable to motion. 모션은 동일한 버스와 리스너, 이미터를 사용합니다 ( 리스너 통합하기 참고).

Wwise Authoring Setup

사운드나 모션 데이터를 장치로 보내려면 라이선스가 있는 Wwise Motion Audio Device를 Wwise 프로젝트에서 Project Explorer의 Audio 탭에 있는 Audio Device 폴더에 추가해야 합니다. Wwise Motion Audio Device는 모션-레디 장치와 소통할 때 사운드 엔진이 사용하는 플러그인입니다. 이 플러그인은 Wwise Motion Audio Device를 상위 레벨 Audio Bus에 할당할 때에도 중요한 역할을 합니다. The term motion bus denotes a top-level Audio Bus with a Wwise Motion Audio Device assigned to it. It is good practice to use a single motion bus hierarchy in your project for easier troubleshooting and monitoring. You can then set the Output Bus of any Sound SFX to a motion bus to create haptic feedback. Usually the Sound SFX elements that use a motion bus also use a Motion source. 오디오와 모션을 동시에 가지려면, Sound SFX에 Output Bus나 Auxiliary Bus로서 최소한 한 개의 모션 버스와 Audio Bus가 있어야 합니다.

Game Setup

On the game side, link with the separate library called AkMotionSink. 이 라이브러리는 지원하는 플랫폼의 표준 컨트롤러를 제공합니다. You also need to include the AkMotionSinkFactory.h file, located under SDK\include\AK\plugin. It is important to include this file because it automatically registers the plug-in.

참고: Unity와 Unreal에서는 플러그인 라이브러리가 자동으로 관리됩니다. 즉 AkMotionSink 를 직접 추가할 필요가 없습니다.

지원하는 컨트롤러와 추가 요구사항에 관한 목록은 다음 표를 참고하세요.

PlatformDeviceDevice Channel Config and LayoutAdditional Requirements
AndroidAndroid device with vibration supportAnonymous 1-channel
iOSiOS device with vibration support
iOS-compatible Controllers
Anonymous 1-channelCoreHaptics.framework
GameController.framework
LinuxNot supported.
MacMac-compatible ControllersAnonymous 1-channelCoreHaptics.framework
GameController.framework
PlayStation 4DUALSHOCK 4
PlayStation 무브
Anonymous 2-channel:
왼쪽 모터, 오른쪽 모터
PlayStation 5DualSense
VR 컨트롤러
Stereo 2-channel:
Left vibration, right vibration
SwitchJoy-ConAnonymous 4-channel:
왼쪽 낮은 진동, 왼쪽 높은 진동,
오른쪽 낮은 진동, 오른쪽 높은 진동
WindowsXbox 및 XInput 호환 컨트롤러
DirectInput 호환 컨트롤러
Anonymous 2-channel:
왼쪽 모터, 오른쪽 모터
XInput.lib
Dinput8.lib
Winmm.lib
Xbox One
Xbox Series X
Xbox 컨트롤러Anonymous 4-channel:
왼쪽 모터, 오른쪽 모터,
왼쪽 트리거, 오른쪽 트리거


만약 애플리케이션이 모션을 하나 이상의 장치에 사용할 경우 각 장치에 대해 별도로 지정된 출력을 추가해줘야 합니다. 예를 들어, 4인 플레이어가 연결된 분할 화면 게임은 컨트롤러가 햅틱 피드백을 받기 위해 네 개의 서로 다른 출력이 필요합니다. To add an output device, use the Wwise API's AK::SoundEngine::AddOutput function and specify the ShareSet name (as defined in your Wwise project) in the AkOutputSettings parameter. 추가로, 복수의 장치가 연결되기 때문에 장치 ID를 제공해줘야 합니다. The following table contains more information about device IDs.

PlatformDeviceInformation
AndroidAndroid device with vibration supportUse 0.
iOSiOS device with vibration support and iOS-compatible ControllersTo vibrate the device, use 0. To vibrate a connected controller, first assign a player index to the desired GCController instance using the GameController.framework API. Then, retrieve the DeviceID of that player index by calling AK::SoundEngine::GetDeviceIDFromPlayerIndex.
LinuxNot supported.-
MacMac-compatible ControllersFirst, assign a player index to the desired GCController instance using the GameController.framework API. Then, retrieve the DeviceID of that player index by calling AK::SoundEngine::GetDeviceIDFromPlayerIndex.
PlayStation 4DUALSHOCK 4 and PlayStation MoveUse the handle of the device returned by scePadOpen or scePadGetHandle.
PlayStation 5DualSense 및 VR 컨트롤러scePadOpen나 scePadGetHandle에 의해 반환되는 장치의 핸들을 사용합니다. For PSVR2, create only one output device, using the handle of either the left or right VR controller, to have vibrations on both VR controllers. If you specify a device ID of 0, the system is only initialized for the wireless controller, not the VR controllers.
The Advanced vibration control mode, which is required for haptic feedback, is enabled in the System Software by default for DualSense and VR Controllers on PlayStation 5. If your code calls scePadSetVibrationMode, ensure that you do not use any behavior that disables Advanced vibration control mode, such as setting a vibration mode of SCE_PAD_VIBRATION_MODE_COMPATIBLE.
SwitchJoy-ConUse nn::hid::NpadId with the desired index.
WindowsXbox 및 XInput 호환 컨트롤러0과 3 사이의 플레이어 인덱스를 사용합니다.
WindowsDirectInput 호환 컨트롤러DIDEVICEINSTANCE에 저장된 guidProduct를 사용합니다. AK::FNVHash32 를 사용해 guidProduct를 해시합니다.
Xbox One (XDK)Xbox ControllersUse the ID stored in a IGamepad object.
Xbox One (GDK)
Xbox Series X
Xbox 컨트롤러AK::SoundEngine::GetGameInputDeviceID 를 호출해 게임패드의 DeviceID를 구합니다.


참고: On all platforms except Windows, a device ID of "0" targets the first available device that supports motion.

Remember that game controllers can be disconnected either physically or due to communication problems. Disconnection does not have any adverse effects on the sound engine other than needlessly using resources. If you think a device has been disconnected for a long time, call AK::SoundEngine::RemoveOutput and provide the AkOutputDeviceID returned by the corresponding AddOutput() function call.

Multiplayer Considerations

Motion outputs are like any other Secondary Outputs and therefore have the same restrictions and requirements. If you are making a single-player game, in which only one player controls the game locally, the Listener/Game Object setup is very simple. In normal cases, the new motion output re-uses the same default Listener as the main audio output. In other words, you rarely have to manage Listeners in a single-player setup.

For multiplayer games, you must create one Listener/Game Object for each motion output. This is necessary so that each player has their own mix of haptic feedback, depending on the situation in the game. 장치와 연관된 Listener는 반드시 AK::SoundEngine::AddOutput() 에 의해 해당 출력이 초기화되는 동시에 함께 초기화되어야 합니다. 지정된 Listener는 사운드나 모션을 전송하는 추가 레이어를 제공합니다. 해당 플레이어의 Listener와 고유하게 연결된 Game Object에 Event를 재생하면 특정 플레이어를 지정할 수 있습니다. To establish this association, you can call AK::SoundEngine::SetListeners. You can also associate multiple listeners with the same game object, which has a "broadcast" effect on all listeners. Listener와 게임 오브젝트에 대한 더 많은 정보는 리스너 통합하기 를 확인하세요.

참고: A sound needs to be routed into the motion bus hierarchy even if the Emitter has a Listener set to a motion output.

예제

The following examples demonstrate how to set up your application to use motion. You can also refer to the Demo Motion example in the Integration Demo (DemoMotion.cpp) included in the SDK samples. 여기에는 지원하는 모든 플랫폼에서 대해 작동하는 예제가 나와있습니다.

단일 플레이어 구축

First, as with any other plug-in, you need to include the corresponding file and link the library (for Wwise native development only, not required for Unity).

#include "AkMotionSinkFactory.h" //Link to AkMotionSink.lib, implements the output to ga

Next, add another output with the Wwise Motion Audio Device ShareSet name from the Wwise project, in this case "Wwise_Motion". The output ID is 0 to ensure that the first connected game controller is used.

AkOutputSettings outputSettings("Wwise_Motion", 0);
AK::SoundEngine::AddOutput(outputSettings);

Next, play an Event. In the Wwise project, the "Play_Explosion" Event is linked to a Sound SFX that is routed to a bus that has "Wwise_Motion" ShareSet assigned as its Audio Device.

AkGameObjectID explosionGO = 100;
AK::SoundEngine::RegisterGameObj(explosionGO, "Explosion");
AK::SoundEngine::PostEvent("Play_Explosion", explosionGO);

멀티플레이어 구축

This section describes how to set up motion for multiple players on the same console, not a networked multiplayer game. In multiplayer scenarios, the mix for motion, or any player-specific output, must be different to represent the player's perspective in the game world. Players therefore need their own Listeners.

int NUM_PLAYERS = 4;
const AkGameObjectID OBJ_FOR_PLAYER[MAX_PLAYERS] = {100 ,200, 300, 400}; // 임의의 Game Object ID를 사용합니다.
for(int i = 0; i < NUM_PLAYERS; i++)
{
AK::SoundEngine::RegisterGameObj(OBJ_FOR_PLAYER[i]); // Listener로 사용할 GameObject를 등록합니다.
AK::SoundEngine::SetListeners(OBJ_FOR_PLAYER[i], &OBJ_FOR_PLAYER[i], 1); // 직접 수신할 수 있는 Game Object를 만듭니다.
}

Add an output for every player. You can use an Audio Device ShareSet multiple times, so you don't have to create multiple Audio Device ShareSets. You must provide a real device ID for every controller. 이 예제는 Windows의 Xbox 컨트롤러를 사용합니다. 특정 플랫폼에 대한 장치 ID를 구하는 방법은 Game Setup 표를 참고하세요.

const AkUInt32 DEVICE_SPECIFIC_ID[MAX_PLAYERS] = {0, 1, 2, 3}; // Windows의 Xbox 컨트롤러에 대한 장치 ID는 간단히 0부터 3 사이 값입니다. 다른 플랫폼들은 그에 따라 다른 요구사항이 있습니다.
for(i = 0; i < NUM_PLAYERS; i++)
{
AkOutputSettings settings("Wwise_Motion", DEVICE_SPECIFIC_ID[i]); // 'Wwise_Motion' ShareSet를 사용해 장치 DEVICE_SPECIFIC_ID[i]를 다룹니다.
res = AK::SoundEngine::AddOutput(settings, &motionOutputIDs[i], &OBJ_FOR_PLAYER[i], 1); // 출력을 추가해 적절한 Listener로 연결합니다.
}

Next, play an Event. In the Wwise project, the "Play_GunFire" Event is linked to a Sound SFX that is routed to a bus that has "Wwise_Motion" assigned as its Audio Device ShareSet.

AK::SoundEngine::PostEvent("Play_GunFire", OBJ_FOR_PLAYER[0]); // Game Object-Listener 관계에 따라 플레이어 컨트롤러 0에서만 재생하게 됩니다.

To play an Event that affects multiple devices, set up a new Game Object, and ensure that all player-specific Listeners listen to it.

AK::SoundEngine::RegisterGameObj(explosionGO, "Explosion"); // 폭발음을 재생할 Game Object를 등록합니다.
AK::SoundEngine::SetListeners(explosionGO, OBJ_FOR_PLAYER, 4); // 플레이어의 리스너 4개 전부를 Game Object에 연결해 Motion Effect를 모두 다 받을 수 있도록 합니다.
AK::SoundEngine::PostEvent("Play_Explosion",explosionGO ); // 4개의 모든 리스너가 explosionGO에 연결되어 있기 때문에, Play_Explosion Event가 모든 게임 오브젝트에 전송됩니다.

For an example of multiplayer setup, refer to the DemoMotion class in the IntegrationDemo sample.

확인사항 및 문제해결

For a specific device to receive motion with one device, you must:

  1. Add a Wwise Motion Audio Device ShareSet to your project.
  2. Create a top-level Audio Bus and set its Audio Device to the Wwise Motion Audio Device ShareSet you just added.
  3. Create Sound SFXs and route them to the motion bus hierarchy.
  4. In the game, link to the AkMotionSink library. Include AkMotionSinkFactory.h and link with the AkMotionSink library.
    참고: Unity와 Unreal에서는 플러그인 라이브러리가 자동으로 관리됩니다. This step is unnecessary.
  5. Create a Game Object to call and receive motion Events with AK::SoundEngine::RegisterGameObj.
  6. Call Ak::SoundEngine::AddOutput with the Wwise Motion ShareSet and a device ID. For multiplayer, provide a Listener object for each.
  7. Trigger your Events the same way you do for audio Events.

To add Motion to the Wwise project:

  1. Add a Wwise Motion Audio Device ShareSet to your project.
  2. Create a top-level Audio Bus and set its Audio Device to the Wwise Motion Audio Device ShareSet you just added.
  3. Create Sound SFXs and route them to the motion bus hierarchy.
  4. In the Audio Preferences, locate the busses you want to use motion with and, from the list, set the device of each bus to the motion device of your choice.

프로파일링

To troubleshoot problems, we recommend that you profile your application. In Wwise Authoring, you can profile your application as described in Profiling. 몇몇 도구는 문제가 있는 소스코드를 이해하는 데 도움이 될 수 있습니다. The Capture Log view lists error codes in red. Graph 뷰는 사운드 엔진 파이프라인을 시각적으로 표현해 출력합니다. The motion devices appear at the end of the pipeline. If no motion devices are displayed, the sound engine could not find the device you specified. Finally, the Emitter/Listener tab displays all Emitter-Listener pairs. If the Motion Effect does not work, the Emitter might not be associated with the Listener you specified for your motion device.

Motion 효과를 트리거 했지만 작동하지 않는다면, 다음 사항을 확인하세요.

  • Check the Capture Log to ensure that there are no registration errors with the plug-in. If there are, confirm that you included the AkMotionSinkFactory.h and linked to the AkMotionSink library.
  • Ensure that the sound engine initialized the device. If it didn't, an error is displayed in the Capture Log when AddOutput is called from the game.
  • Ensure that the Sound SFX you play is routed to a bus that leads to a motion device. Check the Audio Bus property of the Sound SFX, and the Audio Device property of the bus.
  • Voices Graph 탭에서 각 Emitter의 트리거를 확인하세요. Ensure that there is an associated Listener in the Emitter-Listener tab. The same Game Object can emit and listen. If there is no associated Listener, review your calls to RegisterGameObj, SetListeners, and AddOutput.
  • Ensure that the Listener is associated with the desired output device.
  • Review the results of any API calls you made and check for errors.

For Android devices, add the permission in the application's AndroidManifest.xml file:

<uses-permission android:name="android.permission.VIBRATE"/>
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypes.h:142
AKSOUNDENGINE_API AKRESULT RegisterGameObj(AkGameObjectID in_gameObjectID)
AkUInt32 AkDeviceID
I/O device ID
Definition: AkTypes.h:160
Platform-independent initialization settings of output devices.
#define AKMOTIONSINK_DYNAMIC_LINK_SCEPAD_FUNCTIONS
AKSOUNDENGINE_API AKRESULT SetListeners(AkGameObjectID in_emitterGameObj, const AkGameObjectID *in_pListenerGameObjs, AkUInt32 in_uNumListeners)
#define AKMOTIONSINK_STATIC_LINK_SCEPAD_FUNCTIONS
AKSOUNDENGINE_API AKRESULT AddOutput(const AkOutputSettings &in_Settings, AkOutputDeviceID *out_pDeviceID=NULL, const AkGameObjectID *in_pListenerIDs=NULL, AkUInt32 in_uNumListeners=0)
#define AKMOTION_SCEPAD_HAPTICS_MODE
uint32_t AkUInt32
Unsigned 32-bit integer
AKSOUNDENGINE_API AkPlayingID PostEvent(AkUniqueID in_eventID, AkGameObjectID in_gameObjectID, AkUInt32 in_uFlags=0, AkCallbackFunc in_pfnCallback=NULL, void *in_pCookie=NULL, AkUInt32 in_cExternals=0, AkExternalSourceInfo *in_pExternalSources=NULL, AkPlayingID in_PlayingID=AK_INVALID_PLAYING_ID)

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

지원이 필요하신가요?

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

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

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

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

Wwise를 시작해 보세요