Wwise SDK 2023.1.7
|
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 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.
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 섹션을 참고하세요.
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.
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 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가 있어야 합니다.
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 를 직접 추가할 필요가 없습니다. |
지원하는 컨트롤러와 추가 요구사항에 관한 목록은 다음 표를 참고하세요.
Platform | Device | Device Channel Config and Layout | Additional Requirements |
Android | Android device with vibration support | Anonymous 1-channel | |
iOS | iOS device with vibration support iOS-compatible Controllers | Anonymous 1-channel | CoreHaptics.framework GameController.framework |
Linux | Not supported. | ||
Mac | Mac-compatible Controllers | Anonymous 1-channel | CoreHaptics.framework GameController.framework |
OpenHarmony | OpenHarmony device with vibration support | Anonymous 1-channel | |
PlayStation 4 | DUALSHOCK 4 PlayStation 무브 | Anonymous 2-channel: 왼쪽 모터, 오른쪽 모터 | |
PlayStation 5 | DualSense VR 컨트롤러 | Stereo 2-channel: Left vibration, right vibration | |
Switch | Joy-Con | Anonymous 4-channel: 왼쪽 낮은 진동, 왼쪽 높은 진동, 오른쪽 낮은 진동, 오른쪽 높은 진동 | |
Windows | Xbox 및 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.
Platform | Device | Information |
Android | Android device with vibration support | Use 0. |
iOS | iOS device with vibration support and iOS-compatible Controllers | To 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. If want to use resident mode, add AKMOTION_RESIDENT_MODE to DeviceID. Normally, vibrations are ignored for a few tens of milliseconds when starting from silence, but this delay is eliminated when running in resident mode. However, running in resident mode slightly increases the power consumption of the device. |
Linux | Not supported. | - |
Mac | Mac-compatible Controllers | 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. If want to use resident mode, add AKMOTION_RESIDENT_MODE to DeviceID. Normally, vibrations are ignored for a few tens of milliseconds when starting from silence, but this delay is eliminated when running in resident mode. However, running in resident mode slightly increases the power consumption of the device. |
OpenHarmony | OpenHarmony device with vibration support | Use 0. |
PlayStation 4 | DUALSHOCK 4 and PlayStation Move | Use the handle of the device returned by scePadOpen or scePadGetHandle. |
PlayStation 5 | DualSense 및 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. |
Switch | Joy-Con | Use nn::hid::NpadId with the desired index. |
Windows | Xbox 및 XInput 호환 컨트롤러 | 0과 3 사이의 플레이어 인덱스를 사용합니다. |
Windows | DirectInput 호환 컨트롤러 | DIDEVICEINSTANCE에 저장된 guidProduct를 사용합니다. AK::FNVHash32 를 사용해 guidProduct를 해시합니다. |
Xbox One (XDK) | Xbox Controllers | Use 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.
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).
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.
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.
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.
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 표를 참고하세요.
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.
To play an Event that affects multiple devices, set up a new Game Object, and ensure that all player-specific Listeners listen to it.
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:
AkMotionSink
library. Include AkMotionSinkFactory.h
and link with the AkMotionSink
library. 참고: Unity와 Unreal에서는 플러그인 라이브러리가 자동으로 관리됩니다. This step is unnecessary. |
AK::SoundEngine::RegisterGameObj
.Ak::SoundEngine::AddOutput
with the Wwise Motion ShareSet and a device ID. For multiplayer, provide a Listener object for each.To add Motion to the Wwise project:
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 효과를 트리거 했지만 작동하지 않는다면, 다음 사항을 확인하세요.
AkMotionSinkFactory.h
and linked to the AkMotionSink
library.AddOutput
is called from the game.RegisterGameObj
, SetListeners
, and AddOutput
.For Android devices, add the permission in the application's AndroidManifest.xml file:
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요