5.4 C++ Play sound

#1
Hi! I have no idea how to do this. I was digging, but nothing.
Found this old topic https://www.cryengine.com/community_arc ... 4&t=116729
But sound system does not exist anymore. Only audio system, and it doesn't have PlaySound, but PlayFile, which I tried to use, but no effect.

Code: Select all

CryAudio::SPlayFileInfo info("Sounds/mySounds/mySound.ogg");
gEnv->pAudioSystem->PlayFile(info);


And yes. My file is valid, I just copied it from gameSDK, but it doesn't work at all. Any ideas?
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: 5.4 C++ Play sound

#4
Maybe try to activate the audio system debugging with the CVar s_DrawAudioDebug. This should provide you with some basic information about he audio system. What does it say about the AudioTranslationLayer, are you really using SDL Mixer ? Where is your listener ? Do you see any events getting triggered by the audio system ?

Cheers,
Alex

Re: 5.4 C++ Play sound

#5
Ok I figured out. The reason was that I approached this topic completely wrong. I still keep forgetting about existance of components. Forgive me :) in the other topic you placed link to github repo with default components and suddenly i remembered about audio default component. Looked into that and based on it I created my own audio component that fits my needs :) I will share how to achieve that tomorrow and will edit this post . Thank you !
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Who is online

Users browsing this forum: No registered users and 1 guest