menu
 

Audiokinetic의 커뮤니티 Q&A는 사용자가 Wwise와 Strata 커뮤니티 내에서 서로 질문과 답변을 하는 포럼입니다. Audiokinetic의 기술 지원팀에게 문의하고 싶으신 경우 지원 티켓 페이지를 사용해주세요.

0 투표

Let's say we have to play many short 3D events in random locations.

To do that, we:

1) create temporary SoundObj

2) set position to it

3) PostEvent to it

... renderAudio()...

4) handle AK_EndOfEvent  callback to delete temp SoundObj

Is it the best way?

Basically, I need something like PostEvent( eventId, AkSoundPos, ... ) without SoundObj

Thank you

General Discussion ILYA L. (190 포인트) 로 부터

1 답변

+1 투표
 
우수 답변

The best way is slightly simpler, you don't have to wait for the Ak_EndOfEvent.

  1. temp = RegisterGameObj();
  2. SetPosition(temp, x,y,z)
  3. PostEvent
  4. UnregisterGameObj(temp);

RenderAudio could be called before or after the UnregisterGameObj, it doesn't matter.  UnregisterGameObj only marks the game object for destruction.  Wwise will keep it alive until all the sounds playing on it are finished.

Mathieu J. (Audiokinetic) (7.1k 포인트) 로 부터
선택됨 ILYA L. 로 부터
Thank you, Mathieu. it's good to know.
What about reusing temp object inplace?
i.e.
temp = RegisterGameObj();
SetPosition(temp, pos1)
PostEvent(event1, temp)
SetPosition(temp, pos2)
PostEvent(event2, temp)
UnregisterGameObj(temp);
...
renderAudio()
...

will event1 have pos1 and will event2 have pos2 in this case?
A game object can have only one position, both sounds will be posted at the same location (pos2).  Don't worry, a game object consumes very little resources.  As long as you don't spawn thousand of them concurrently, you won't hit any performance problem.
Thank you, Mathieu
You, AK guys, are the best when it comes to customer support.
Regards,
Ilya
...