I found this extension
GitHub and now trying to rewrite it to Linux from Windows.
Extension have this snippet for Windows:
Code:
char path[PLATFORM_MAX_PATH];
g_pSM->BuildPath(Path_Game, path, sizeof(path), "../bin/vaudio_celt.dll");
lib = LoadLibrary(path);
if (!lib) {
snprintf(error, maxlength, "LoadLibrary failed.");
return false;
}
CreateInterfaceFn createCodecFn;
createCodecFn = (CreateInterfaceFn)GetProcAddress(lib, "CreateInterface");
if (!createCodecFn) {
snprintf(error, maxlength, "GetProcAddress failed.");
return false;
}
voiceCodec = (IVoiceCodec*)createCodecFn("vaudio_celt", NULL);
if (!voiceCodec) {
snprintf(error, maxlength, "Create Voice VoiceCodec error");
return false;
}
if (!voiceCodec->Init(QUALITY)) {
snprintf(error, maxlength, "Voice VoiceCodec Init error");
return false;
}
sharesys->AddInterface(myself, this);
I changed it too: (P.S. #include <dlfcn.h> needed)
Code:
char path[PLATFORM_MAX_PATH];
g_pSM->BuildPath(Path_Game, path, sizeof(path), "../bin/vaudio_celt_client.so");
g_pModule = dlopen( path, RTLD_NOW );
CreateInterfaceFn createCodecFn;
createCodecFn = (CreateInterfaceFn) dlsym( g_pModule, "CreateInterface" );
if (!createCodecFn) {
snprintf(error, maxlength, "GetProcAddress failed.");
return false;
}
voiceCodec = (IVoiceCodec*)createCodecFn("vaudio_celt", NULL);
if (!voiceCodec) {
snprintf(error, maxlength, "Create Voice VoiceCodec error");
return false;
}
if (!voiceCodec->Init(QUALITY)) {
snprintf(error, maxlength, "Voice VoiceCodec Init error");
return false;
}
sharesys->AddInterface(myself, this);
It compiles normally and loads into csgo "normally" too. It prints Create Voice VoiceCodec error. So error somewhere in this line:
Code:
voiceCodec = (IVoiceCodec*)createCodecFn("vaudio_celt", NULL);
And I don't know what is wrong. Need help.