버전

menu_open
알림: 고객님의 주요 출시 버전( 2019.1.11.7296 )에 해당하는 최신 설명서로 이동했습니다. 특정 버전의 설명서를 보시려면 Audiokinetic 런처에서 오프라인 설명서를 다운로드하고 Wwise Authoring의 Offline Documentation을 확인하세요.
Wwise SDK 2019.1.11
Wwise 오디오 장치 플러그인 생성하기 (싱크 Plug-ins)

오디오 장치 플러그인 인터페이스 구현

오디오 장치 플러그인은 오디오 처리 과정에서 가장 말단이라고 할 수 있습니다. 일반적인 오디오 장치는 OS 사운드 시스템이겠지만, 추가적인 하드웨어나 드라이버를 통해 더 다양한 출력을 사용할 수도 있습니다. 싱크 플러그인의 역할은, 최종 믹스된 오디오 샘플을 받아 장치가 이해할 수 있는 형태로 전송하는 일입니다.

사운드 엔진 컴포넌트

사운드 엔진 단에서 오디오 장치 플러그인을 작성할 때 AK::IAkSinkPlugin interface 를 구현하는 과정이 포함됩니다. 여기서는 이 인터페이스에 국한된 함수들만 다루도록 하겠습니다. 다른 플러그인 타입에서도 사용되는 인터페이스 컴포넌트와 관련한 더 많은 정보는 How to Create Wwise Sound Engine Plug-ins 를 참고하세요 ( AK::IAkPlugin interface ). 또한 예제 코드의 AkSink 플러그인도 제공하고 있으니 참고해보세요 ( 예제 ).

오디오 장치는 항상 사용하는 플러그인(Audio Device ShareSet)과 특정 장치 ID를 통해 지정됩니다. 이 장치 ID는 Wwise 사운드 엔진과는 아무 관련이 없으며, 다만 플러그인을 구현하는 사람이 같은 타입이 여럿 존재하는 장치들을 쉽게 구분할 수 있도록 하기 위한 목적입니다. 장치 ID는 AK::SoundEngine::InitAK::SoundEngine::AddOutput 에서 사용되는 AkOutputSettings::idDevice 매개 변수를 통해 게임으로 전송됩니다. 예를 들어 한 오디오 장치 플러그인이 특정 컴퓨터에서 Windows의 오디오 장치에 접근하려고 할 때 여러 개의 Windows 장치를 발견할 경우가 있습니다.

만약 자신의 장치가 다른 장치들과 구분되지 않아도 무방하다면, 이 매개 변수를 무시해도 됩니다. 그러나 이러한 구현을 위해서는 idDevice 매개 변수가 0 일 때 선택되는 "기본 장치"를 반드시 지원해야 한다는 개념을 인지하고 있어야 합니다. 처음 사용 가능한 장치로 할 지 아니면 0 를 받았을 때 선택되는 특정 장치로 할 지는 플러그인 프로그래머의 선택에 달렸습니다.

When a plug-in is used in the Wwise authoring application, parameters are updated regularly, whether or not the parameter supports RTPCs. This allows the plug-in to support runtime value changes of non-RTPC values if desired for Wwise usage. If you do not want your plug-in to support this at design-time, you should make a copy of the parameter values at initialization time to ensure they remain the same throughout the plug-in's duration.

오디오 장치 플러그인의 Wwise 저작 DLL

다른 플러그인과 마찬가지로, 싱크 플러그인 또한 해당하는 저작 DLL이 필요합니다. 모든 플러그인에 대해 공통으로 적용되는 Wwise 저작 컴포넌트 기본 설정에 대한 정보는 How to Create a Wwise Plug-in DLL 을(를) 참고하세요. Additionally, sink plug-ins can have an extra function exported from the DLL: AkGetSinkPluginDevices. This function's purpose is to fill the possible devices a user can select in the authoring tool to test, in the Audio Hardware Preferences dialog. 이 함수는 선택 사항입니다. 이 함수를 적용하지 않으면 플러그인은 필요시 'default' 출력으로 초기화합니다.

AkGetSinkPluginDevices will be called by Wwise with the plug-in ID, a pre-allocated array of OutputDeviceDescriptor and the maximum size of the array. The maximum length of the device name is AK_MAX_OUTPUTDEVICEDESCRIPTOR (256 characters). You must modify the count (io_uMaxCount) to reflect the number of descriptors correctly filled.

void __stdcall AkGetSinkPluginDevices(unsigned short in_usCompanyID, unsigned short in_usPluginID, AK::Wwise::OutputDeviceDescriptor * io_Devices, unsigned int &io_uMaxCount)
{
if (in_usCompanyID == MY_COMPANY_ID && in_usPluginID == MY_PLUGIN_ID) // Validate the plug-in ID.
{
if (io_uMaxCount > 2) // Make sure there is enough space in the array.
{
wcscpy_s(out_rDesc.name, AK_MAX_OUTPUTDEVICEDESCRIPTOR, L"First Device"); // Copy the name of the first device. (This is visible to the user.)
io_Devices[0].idDevice = 1234; // ID of this device. (Can be anything meaningful for the plug-in; this will get passed back into IAkSinkPlugin::Init.)
wcscpy_s(out_rDesc.name, AK_MAX_OUTPUTDEVICEDESCRIPTOR, L"Second Device"); // Copy the name of the second device. (This is visible to the user.)
io_Devices[1].idDevice = 4567; // ID of this device. (Can be anything meaningful for the plug-in; this will get passed back into IAkSinkPlugin::Init.)
}
}
}

This function must be exported from the DLL, usually by adding a line in the DEF file, as seen below:

LIBRARY "MyPlugin"
EXPORTS
AkCreatePlugin
AkGetSinkPluginDevices
참고: If you want to expose your plug-in in Unity or Unreal, don't forget to create a runtime dynamic library (DLL, SO, DYLIB). This is different from the authoring DLL. See Dynamic Libraries.

자신의 Audio Device 플러그인 시험해보기

플러그인의 Wwise 부분을 구현하고 ( 오디오 플러그인의 Wwise 저작 부분 작성하기 ) 사운드 엔진 부분을 구현한 다음, 다음과 같이 단계별로 자신의 플러그인을 시험해볼 수 있습니다.

  • 자신의 Wwise Project에서 자신의 새 플러그인을 사용하는 Audio Device ShareSet를 생성하세요. 이 ShareSet에 고유한 이름을 부여합니다.
  • 뱅크를 생성합니다.
  • 반드시 자신의 플러그인이 게임 코드에 등록돼있어야 합니다. Wwise Sound Engine Plug-ins Overview 를 참고하세요.
  • 사운드 엔진의 초기화 매개 변수에 자신의 오디오 장치 ID가 사용되도록 지정합니다. AkOutputSettings 의 ID는 프로젝트 내 Audio Device ShareSet의 이름 해시이며, AK::SoundEngine::GetIDFromString 에 의해 부여됩니다.

예시:

AkInitSettings initSettings;
AkPlatformInitSettings platformInitSettings;
initSettings.settingsMainOutput.audioDeviceShareset = AK::SoundEngine::GetIDFromString("YourNewAudioDeviceSharesetNameHere");
AK::SoundEngine::Init( &initSettings, &platformInitSettings );

또 다른 방법으로, AK::SoundEngine::AddOutput 로 자신의 Audio Device 플러그인을 사용해도 됩니다.

AkOutputSettings outputSettings("YourNewAudioDeviceSharesetNameHere", 0 /*Default device*/)'
AK::SoundEngine::AddOutput(outputSettings);

더 자세한 정보는 다음 섹션을 참조하세요.

AkOutputSettings settingsMainOutput
Main output device settings.
Definition: AkSoundEngine.h:224
const char * strLabel
Label of the marker, read from the file
Definition: AkCallback.h:120
AKSOUNDENGINE_API AKRESULT Init(AkInitSettings *in_pSettings, AkPlatformInitSettings *in_pPlatformSettings)
AKSOUNDENGINE_API AKRESULT RegisterGameObj(AkGameObjectID in_gameObjectID)
Platform-independent initialization settings of output devices.
Definition: AkSoundEngine.h:129
AkUInt32 idDevice
Display name of the device. Null terminated. Note that the name can't be more than 256 characters inc...
Definition: AudioPlugin.h:674
AKSOUNDENGINE_API void GetDefaultInitSettings(AkInitSettings &out_settings)
AkUInt32 uIdentifier
Cue point identifier
Definition: AkCallback.h:118
AkUInt32 uPosition
Position in the cue point (unit: sample frames)
Definition: AkCallback.h:119
AKSOUNDENGINE_API void GetDefaultPlatformInitSettings(AkPlatformInitSettings &out_platformSettings)
AKSOUNDENGINE_API AkUInt32 GetIDFromString(const char *in_pszString)
AKSOUNDENGINE_API AKRESULT AddOutput(const AkOutputSettings &in_Settings, AkOutputDeviceID *out_pDeviceID=NULL, const AkGameObjectID *in_pListenerIDs=NULL, AkUInt32 in_uNumListeners=0)
AKSOUNDENGINE_API AkUInt32 GetDeviceIDFromName(wchar_t *in_szToken)
AkUniqueID audioDeviceShareset
Definition: AkSoundEngine.h:142
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를 시작해 보세요