AvarianKnight / pma-voice

An easy drag n' drop resource that gives you a wrapper to use FiveM's built-in mumble voice.
MIT License
225 stars 191 forks source link

Forced to Restart (pma-voice) for voice_useNativeAudio convar to work. #483

Open ItsVinnyX opened 2 months ago

ItsVinnyX commented 2 months ago

Did you read the README?: Yes.

Describe the bug I set my convar to setr voice_useNativeAudio true. Then load into my server after restarting it, upon loading in, over radio the submix is not what it would be with voice_useNativeAudio being set to true.

No errors.

Expected behavior Convar working as intended without having to restart the resource while in game.

Server Info:

Additional Info:

# Voice Configuration
setr voice_useNativeAudio true
setr voice_useSendingRangeOnly true
setr voice_enableUi 0
setr voice_defaultCycle "Z"
setr voice_defaultRadio "CAPITAL"
setr voice_defaultRadioVolume 60
setr voice_defaultCallVolume 80
setr voice_enableRadioAnim 0

ensure pma-voice
AvarianKnight commented 2 months ago

Closing this as it is not a pma-voice issue

ItsVinnyX commented 2 months ago

Closing this as it is not a pma-voice issue

What could be causing this then? Everything is set correctly, but I still am forced to restart the resource. Using 6.6.2 Version, just doesn't make sense.

It's set before runtime in the cfg. Anyway to fix this? Any certain artifact?

ItsVinnyX commented 2 months ago

See here: citizenfx/fivem#2675

Thanks, so there's no work around? I am not manually running the command in-game or in console, it's set as a convar in the cfg.

AvarianKnight commented 2 months ago

Hmm actually I seem to have completely misread this, do you have any other resource that touches voice chat, as that is usually what causes something like this

ItsVinnyX commented 2 months ago

Hmm actually I seem to have completely misread this, do you have any other resource that touches voice chat

I was very confused, HAHA. I have mm_radio and that's about it regarding voice chat. Well I also use Quasar Smartphone PRO

[    script:pma-voice] Initial values from GetConvar:
[    script:pma-voice] voice_useNativeAudio:    true
[    script:pma-voice] voice_useSendingRangeOnly:   true
[    script:pma-voice] voice_enableUi:  0
[    script:pma-voice] voice_defaultCycle:  Z
[    script:pma-voice] voice_defaultRadio:  CAPITAL
[    script:pma-voice] voice_defaultRadioVolume:    60
[    script:pma-voice] voice_defaultCallVolume: 80
[    script:pma-voice] voice_enableRadioAnim:   0
[    script:pma-voice] voice_enableSubmix:  1

I even did some debugs of the convars and they're printing correctly.

ItsVinnyX commented 2 months ago

I got some more information. So let's say I restart the resource, it'll set the convars properly etc. However, if I relog and come back, my convars will act as if I do not have NativeAudio enabled on my end. So it seems to be more or less effected on the clients end. If I restart the resource everyone on the server receives the correct convars, if someone joins after the resource starts, they just get no submixes etc.

AvarianKnight commented 2 months ago

This is the first I'm ever hearing about this and I'm sad to say I can't really think of what might be causing this.

You can check to see if other resources change anything related to submixes, any convars for voice chat, or interact with mumble natives.

ItsVinnyX commented 2 months ago

This is the first I'm ever hearing about this and I'm sad to say I can't really think of what might be causing this.

You can check to see if other resources change anything related to submixes, any convars for voice chat, or interact with mumble natives.

I'll put all of the related in here, I am unsure what exactly can cause this.

RegisterCommand('resetvoice', function()
    NetworkClearVoiceChannel()
    NetworkSessionVoiceLeave()
    Wait(50)
    NetworkSetVoiceActive(false)
    MumbleClearVoiceTarget(2)
    Wait(1000)
    MumbleSetVoiceTarget(2)
    NetworkSetVoiceActive(true)
    QBCore.Functions.Notify("You have successfully reset your voice box.")
end)

Then my Smartphone:

local pma = exports['pma-voice']
local mumble = exports['mumble-voip']
local toko = exports['tokovoip_script']

function AddToCall(callId)
    if Config.Voice == 'pma' then
        pma:addPlayerToCall(callId)
    elseif Config.Voice == 'mumble' then
        mumble:addPlayerToCall(callId)
    elseif Config.Voice == 'salty' then
        TriggerServerEvent('phone:addToCall', callId)
    elseif Config.Voice == 'toko' then
        toko:addPlayerToRadio(callId)
    end
end

function RemoveFromCall(callId)
    if Config.Voice == 'pma' then
        pma:removePlayerFromCall()
    elseif Config.Voice == 'mumble' then
        mumble:removePlayerFromCall()
    elseif Config.Voice == 'salty' then
        TriggerServerEvent('phone:removeFromCall', callId)
    elseif Config.Voice == 'toko' then
        toko:removePlayerFromRadio(callId)
    end
end

Submix in Helicam Script

local function EnableSubmix()
    SetAudioSubmixEffectRadioFx(0, 0)
    SetAudioSubmixEffectParamInt(0, 0, `default`, 1)
    SetAudioSubmixEffectParamFloat(0, 0, `freq_low`, 625.0)
    SetAudioSubmixEffectParamFloat(0, 0, `freq_hi`, 8000.0)
    SetAudioSubmixEffectParamFloat(0, 0, `fudge`, 0.5)
    SetAudioSubmixEffectParamFloat(0, 0, `rm_mix`, 50.0)
    submix = true
end

local function DisableSubmix()
    SetAudioSubmixEffectRadioFx(0, 0)
    SetAudioSubmixEffectParamInt(0, 0, `enabled`, 0)
    submix = false
end

But this is only enabled via a config, it's currently false.

That's everything with Submixes & Mumble. Everything else has to do with pma-voice.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

AvarianKnight commented 1 month ago

Tagging this so it wont be closed again, I don't have the time to look into this currently but I'll try to in the future.

ItsVinnyX commented 1 month ago

Tagging this so it wont be closed again, I don't have the time to look into this currently but I'll try to in the future.

Appreciated!