バージョン

menu_open
警告:このページでは、一部の保護された情報が表示されません。
あなたが特定プラットフォームのライセンスを所有しているユーザであれば、最初にログインしてください。
Wwise SDK 2023.1.3
セカンダリ出力の統合

Wwiseでは、セカンダリ出力には、通常のTVオーディオ出力ではないいずれの物理的オーディオエンドポイントを指定します。The most common secondary outputs are headsets, game controller speakers, and haptic feedback for game controllers. Haptic feedback integration is described in detail in Wwiseモーションの統合. This topic focuses on audio outputs (headsets and controller speakers).

You can use secondary outputs to define separate mixes for each of these outputs without affecting the main speaker/TV mix. The same Wwise feature set applies to the secondary outputs as for the regular mix. The only difference is that the output targets controllers instead of the speaker/TV.

バスルーティング

オーサリング側では、オーディオデバイスの別のミックスを設定できるように新しいマスターバスを作成します。次にその新しいバスの Audio Device ShareSet プロパティを変更して、別のデバイスにポイントさせます。なお、サードパーティが作成したオーディオデバイスプラグインを使用する場合は、まずプラグインタイプに合ったオーディオデバイスシェアセットを作成する必要があるかもしれません。これで、音を通常通り新しいバスや子バスにルーティングできます。Wwiseで使えるオーディオデバイスに関する情報は、Audio Devicesを参照してください。

1つのセカンダリアウトプットインスタンスだけに通常は紐づけられるようなサウンドの、望ましいメソッドは、アウトプットバスを直接設定することです。例えば、プレイヤーが発射するガンショット、テニスラケットの打音、PDAの音、ゲームプレイのフィードバックなど。ただし、User SendやGame Sendを使って、ほかのバス階層の中のAuxバスにセンドすることができます。これは同じサウンドが複数のアウトプットとテレビから同時に聞こえてくる場合に向き、例えばスパイカメラやアナウンスなどが考えられます。

複数のコントローラとTVで同時に、同じソースを使用して、同じサウンドを再生することは可能です。デザイン側では、ゲームを何人のプレイヤーがプレイしているかの知識はありません。バス階層は、ゲーム側から登録されている各出力へのルーティングのテンプレートとして使用されます。よって各出力は、再生されるサウンド、ゲームオブジェクトでアクティブなRTPC ならびにSwitch値によって、異なるミックスやエフェクトが適用されている可能性があります。以下のセクションの で、このような場合を見てみます。

出力の同期についての注意点

TVやゲームコントローラなど、多くのデバイスで同じオーディオを出力する場合、デバイスの間でのレイテンシに気づくことがあるでしょう。これは、オーディオ信号パスにおける、ハードウェアの違いのため、避けることはできません。コントローラ側では、この信号は無線のチャンネルを通過しなければならず、これが有線のコントローラと異なるディレイを与える可能性があります。TVでは、一度信号がコンソールを出ると、受信機および/またはTVを通過し、これのプロセッサーがある程度のディレイを追加します。AVの設定によって発生するディレイが各システムで異なるため、スピーカー/TVならびにゲームコントローラへ同時にルートされるサウンドを同期させるのは不可能です。サウンドをデザインする場合、この制限を考慮する必要があります。

複数出力のための、デバイス、リスナー、およびゲームオブジェクトの設定

同じタイプの複数の出力の場合(例えばゲームコントローラのスピーカーなど)、デバイスの各インスタンスを差別化する必要があります。通常のリスナー・ゲームオブジェクトの概念が、特定リスナー・エミッタのルーティングを許容するので、これを利用します。詳細については Understanding listeners を参照して下さい。AK::SoundEngine::AddOutputを利用して出力デバイスとリスナーを関連付けることは、プログラマーの責任になります。プログラマーは、リスナーとゲームオブジェクトの関連付けを、AK::SoundEngine::SetActiveListenersを使って設定します。1つの音を同時に複数のデバイスで再生する場合は、複数のリスナーを指定できることを、覚えておいてください(以下の例を参照)。

注釈: 特定のタイプ(例: システム、DVR)で1つの出力しかない場合は、複数のリスナーを設定する必要はありません。この場合Wwiseは、Wwiseプロジェクトで指定したルーティングに依存できます。プレイヤーを特定した出力(例: ゲームコントローラスピーカー、コミュニケーションなど)の場合も、シングルプレイヤーのゲームであれば、同じことが言えます。つまり、ゲームでアクティブなコントローラが1つだけの場合です。リスナーに関する詳細は、 リスナーの統合 をご覧ください。
注釈: プレイヤーデバイスの場合、ゲームコントローラがシステムに接続したり、接続が切れたりする度に、ゲームコードがAK::SoundEngine::AddOutputAK::SoundEngine::RemoveOutputをコールする必要があります。Wwiseは、どのデバイスがどのリスナーに、そして概念としてどのプレイヤーに関連付けるられているのかを、自動的に検知することができません。システムデバイス(メイン出力、DVRなど)は、Wwiseが自動的に対応します。

これらの例はPS4向けに書かれましたが、他の全てのプラットフォームにも適用できます。関数AK::SoundEngine::AddOutputのドキュメンテーションを確認してください。複数の出力を管理する実際の事例を見るには、 Integration Demoサンプル や、DemoMotionページ(マルチプレイヤ)や、BGMDemoページ(DVR/BGM管理)を参照してください。

注釈: これらの例は読みやすくするために、ファンクションコールの前に必要なAK::SoundEngineを省略してあります。

Code to get the UserIDs (PS4 example only. Refer to デフォルトのWwise Audio Devices for other platforms):

SceUserServiceLoginUserIdList list;
sceUserServiceGetLoginUserIdList(&list);

1つのゲームコントローラ出力でのサウンド:

// プレイヤー0のスピーカーエンドポイントに接続されたセカンダリアウトプットを追加します。
AkOutputSettings outputSettings("Game Controller Speaker", list.userId[0] /*Player ID (first player)*/);
AddOutput(outputSettings);
// Play an Event. Wwiseプロジェクトで、この音をマスターバスにルーティングして、そのマスターバスで出力を"Game Controller Speaker" (またはサブバス)に設定します。
PostEvent("Play_Pow", MY_GAME_OBJECT);

2つの異なるコントローラでの同じサウンド:

// Add a secondary output connected to the speaker output for player 0, associated with listener #1.
AkOutputSettings outputSettings1("Game Controller Speaker", list.userId[0] /*Player ID (first player)*/);
AddOutput(outputSettings1, NULL, listenerArray1, 1);
// Add a secondary output connected to the speaker output for player 1, associated with listener #2.
AkOutputSettings outputSettings2("Game Controller Speaker", list.userId[1] /*Player ID (first player)*/);
AddOutput(outputSettings2, NULL, listenerArray2, 1);
// Set a game object to emit sound to the listener 1(player 0) and 2 (player 1).
SetActiveListeners(EXISTING_GAME_OBJECT, listenerArrayBoth, 2);
// Play an Event. Wwiseプロジェクトで、この音をマスターバスにルーティングして、そのマスターバスで出力を"Game Controller Speaker" (またはサブバス)に設定します。
PostEvent("Play_Pow", EXISTING_GAME_OBJECT);

2つの異なるコントローラでの、異なるサウンド:

// Add a secondary output connected to the speaker output for player 0, associated with listener #1.
AkOutputSettings outputSettings1("Game Controller Speaker", list.userId[0] /*Player ID (first player)*/);
AddOutput(outputSettings1, NULL, listenerArray1, 1);
AkOutputSettings outputSettings2("Game Controller Speaker", list.userId[1] /*Player ID (first player)*/);
AddOutput(outputSettings2, NULL, listenerArray2, 1);
// Set a game object to emit sound to the proper listeners.
RegisterGameObj(MY_GAME_OBJECT1, listenerArray1, 1);
SetActiveListeners(MY_GAME_OBJECT1, listenerArray1, 1);
RegisterGameObj(MY_GAME_OBJECT2, listenerArray2, 1);
SetActiveListeners(MY_GAME_OBJECT2, listenerArray2, 1);
// Play an Event. Wwiseプロジェクトで、この音をマスターバスにルーティングして、そのマスターバスで出力を"Game Controller Speaker" (またはサブバス)に設定します。
PostEvent("Play_Pow", MY_GAME_OBJECT1);
PostEvent("Play_Pif", MY_GAME_OBJECT2);

1つのゲームコントローラとTVでの同じサウンド:

// Add a secondary output connected to the speaker output for player 0, associated with listener #1.
AkOutputSettings outputSettings1("Game Controller Speaker", list.userId[0] /*Player ID (first player)*/);
AddOutput(outputSettings1, NULL, listenerArray1, 1);
// Set a game object to emit sound to the listener 0 (TV) and 1 (controller for player 0).
AkGameObjectID [] listenerArrayWithDefault = {MY_MAIN_LISTENER, MY_LISTENER1}; // MY_MAIN_LISTENER is the listener you normally use, defined by AK::SoundEngine::SetDefaultListeners.
RegisterGameObj(MY_GAME_OBJECT);
SetActiveListeners(MY_GAME_OBJECT, listenerArrayWithDefault, 2);
// Play an Event.
// Wwiseプロジェクトで、この音をマスターバスにルーティングして、そのマスターバスで出力を"Game Controller Speaker" (またはサブバス)に設定します。
// Also, this sound must have an Auxiliary send routed to the master Audio Bus.
PostEvent("Play_Pow", MY_GAME_OBJECT);

これは、Windowsでセカンダリアウトプット、つまり主にヘッドフォンを追加する例です。

注釈: Windowsでは、全てのデバイスが"System"デバイスと呼ばれます。そこで、デバイスを追加するときに、デバイス同士を区別できなければなりません(詳しくは 複数出力のための、デバイス、リスナー、およびゲームオブジェクトの設定 for information 参照)。このため、別のリスナーが必要となります。
// Will search for a device that has "Headphones" in its name.
uDeviceID = AK::GetDeviceIDFromName("Headphones");
// Add a secondary output connected to the device found previously, associated with listener1.
AkOutputSettings outputSettings1("System", uDeviceID);
AddOutput(uoutputSettings1, NULL, listenerArray1, 1);
// Register a game object associated only with listener1.
RegisterGameObj(MY_GAME_OBJECT, listenerArray1, 1);
// Play an Event. Wwiseプロジェクトで、この音をマスターバスにルーティングして、そのマスターバスで出力を"System" (またはサブバス)に設定します。
PostEvent("Play_Pow", MY_GAME_OBJECT);
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypes.h:142
AKRESULT
Standard function call result.
Definition: AkTypes.h:213
AKSOUNDENGINE_API AKRESULT RegisterGameObj(AkGameObjectID in_gameObjectID)
AKSOUNDENGINE_API AkUInt32 GetDeviceID(IMMDevice *in_pDevice)
Platform-independent initialization settings of output devices.
#define NULL
Definition: AkTypes.h:46
AkUInt32 AkUniqueID
Unique 32-bit ID
Definition: AkTypes.h:134
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)
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
AkUniqueID audioDeviceShareset
AkChannelConfig channelConfig
AkUInt64 AkOutputDeviceID
Audio Output device ID
Definition: AkTypes.h:167
#define AK_SPEAKER_SETUP_STEREO
2.0 setup channel mask
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からはじめよう