+1 vote

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.

asked May 16 in Engine by KramchayDig (51 points)

What do you mean by an "audio"? Are you trying to program an audio format that's unsupported in the engine?

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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.