Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

How do i play event sound using WAAPI and JavaScript?

0 votes

 

I've tried to post events but no sound is played.

const resultId = await connection.call(ak.soundengine.postEvent, {
  gameObject: 10,
  event: "SFX",
});

The only way to get anything playing is to use transport

const { transport } = await connection.call(ak.wwise.core.transport.create, {
  object: "{987BC7F5-1F5B-467D-8FCD-DC076E39598C}" //SFX event ID
})

await connection.call(ak.wwise.core.transport.executeAction, {
  action: "play",
  transport: transport
})

Is there a simpler way? In various docs i've found reference to this statement "Posting an event will post a request to play something. This request will not be processed until the game calls the function RenderAudio();" but there is no way to call RenderAudio from JS.

// https://www.audiokinetic.com/library/edge/?source=SDK&id=soundengine_events.html

asked Jun 3 in General Discussion by Marcin I. (100 points)

Please sign-in or register to answer this question.

...