how do I add and play an audio in GDNative (C++)?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By KramchayDig

It’s hard to find any answers from Google about this question I’ll go ahead and make one myself. I’m wondering how do I add and play an audio in C++ since I need both of them in order to have a playable sound effect (or even music) in my game.

What do you mean by an “audio”? Are you trying to program an audio format that’s unsupported in the engine?

Ertain | 2020-05-16 05:51

in gdscript it uses AudioStreamPlayer to load an audio to play a sound in runtime while in code. I want to know how to use an AudioStreamPlayer in C++ that implies to both add a resource of an audio and play that audio as a sound (.wav) or a music (.ogg). I’m sure that the engine have support for the audio player in C++ it’s a very common use in making a game.

KramchayDig | 2020-05-16 06:00