+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.

in Engine by (87 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.