Minor - Adds basic audio component functionality - V13.2.0

Adds basic audio component and loads default sound for testing

Adds default sounds to the assets folder and includes them in the project.
This commit is contained in:
2025-09-15 16:08:46 +02:00
parent 5bb802f0fc
commit 5ee88ff932
4 changed files with 32 additions and 12 deletions

View File

@@ -98,9 +98,14 @@ public:
ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Erreur: %s", m_lastError.c_str());
}
static char path[256] = "F:/Github_Repo/khaotic-engine-Reborn/x64/Release/assets/sounds/default.mp3";
// exe path + assets/sounds/default.mp3
std::filesystem::path defaultSoundPath = std::filesystem::current_path() / "assets" / "sounds" / "default.mp3";
std::string defaultSoundPathStr = defaultSoundPath.string();// Input text with default path
char path[260];
strncpy_s(path, m_soundPath.empty() ? defaultSoundPathStr.c_str() : m_soundPath.c_str(), sizeof(path));
path[sizeof(path) - 1] = '\0'; // Assurer la termination nulle
ImGui::InputText("Chemin du fichier", path, sizeof(path));
if (ImGui::Button("Charger le son")) {
if (!Load(path)) {
// L'erreur est d<>j<EFBFBD> d<>finie dans Load()