voicechat
voicechat
This library adds a few functions allowing handling of the voicechat.
Recently Changed
This was recently changed in version (0.72).
This module caused a crash on server shutdown in version 0.7
and 0.71
, this was fixed in the 0.72
release.
See https://github.com/RaphaelIT7/gmod-holylib/issues/41 for more.
Methods
Applies the given effectData to the given Data/Stream.
If a callback is specified it WONT return anything and the callback will be called, as it will execute everythign async.
If you want it to not run async, simply provide no callback function, it will return true on success
It should be safe to modify/use the VoiceStream while it's being modified async BUT you should try to avoid doing that.
If a callback is specified it WONT return anything and the callback will be called, as it will execute everythign async.
If you want it to not run async, simply provide no callback function, it will return true on success
It should be safe to modify/use the VoiceStream while it's being modified async BUT you should try to avoid doing that.
Sends the given voice data all clients, or only the given table of clients.
Creates a new VoiceData with the given data.
VoiceStream voicechat.CreateVoiceStream( )
Creates a empty VoiceStream.
Returns whether the given client can hear the target client.
Returns whether the given player is considered to be actively talking.
Returns whether the given client can hear the target client in it's proximity.
Returns the last time the given player has talked.
VoiceStream, number voicechat.LoadVoiceStream( string fileName, string gamePath = DATA, function callback = nil )
Tries to load a VoiceStream from the given file.
Meaning of the statusCode:
If async was used, it won't return anything.
This function also supports .wav files to load from since 0.8
Meaning of the statusCode:
Number | Meaning |
---|---|
-2 | File not found |
-1 | Invalid type |
0 | None |
1 | Done |
VoiceStream, number voicechat.LoadVoiceStreamFromWaveString( string waveData, function callback = nil, boolean promiseToNeverModify = false )
Tries to load a VoiceStream from the given data.
Meaning of the statusCode:
If async was used, it won't return anything.
Meaning of the statusCode:
Number | Meaning |
---|---|
-2 | File not found |
-1 | Invalid type |
0 | None |
1 | Done |
Let's the server process the VoiceData like it was received from the client.
This can be a bit performance intense.
This will ignore the set player slot!
This can be a bit performance intense.
This will ignore the set player slot!
number, string voicechat.SaveVoiceStream( VoiceStream voiceStream, string fileName = nil, string gamePath = DATA, function callback = nil, boolean returnWaveData = false )
Sends the given voice data to the given client.
Meaning of the statusCode:
If async was used, it won't return anything.
This function also supports .wav files to write the data into since 0.8.
You should always inform your players if you save their voice!
You can set both fileName and returnWaveData which will cause it to be written to disk and the data to be returned
If fileName and returnWaveData are both not set then it will error as atleast one of them needs to be enabled.
Meaning of the statusCode:
Number | Meaning |
---|---|
-2 | File not found |
-1 | Invalid type |
0 | None |
1 | Done |
This function also supports .wav files to write the data into since 0.8.
You should always inform your players if you save their voice!
You can set both fileName and returnWaveData which will cause it to be written to disk and the data to be returned
If fileName and returnWaveData are both not set then it will error as atleast one of them needs to be enabled.
Sends a empty voice data to the given client.
Sends the given voice data to the given client.