Convai Player
Actor component for the player
Last updated
Actor component for the player
Last updated
Convai Player is an Actor component responsible for capturing microphone audio and streaming it to a Convai character.
For voice chat to work in multiplayer, this component must be added to the player's possessed object and not the PlayerController.
Is Recording()
Boolean
Returns True
if microphone audio is recorded, False
otherwise.
Is Talking()
Boolean
Returns True is microphone audio is been streamed, false otherwise.
Start Recording()
Void
Start recording audio from microphone, use "Finish Recording" function afterwards.
Finish Recording()
USoundWave*
Stops recording from the microphone and outputs the recorded audio from microphone.
Send Text(
UConvaiChatbotComponent* ConvaiChatbotComponent,
FString Text,
UConvaiEnvironment* Environment, bool GenerateActions,
bool VoiceResponse,
bool RunOnServer,
bool UseServerAPI_Key
)
Void
Sends text to character.
Start Talking(
UConvaiChatbotComponent* ConvaiChatbotComponent, UConvaiEnvironment* Environment, bool GenerateActions,
bool VoiceResponse,
bool RunOnServer,
bool StreamPlayerMic,
bool UseServerAPI_Key
)
Void
Starts streaming microphone audio to the character. Use "Finish Talking" afterwards to let the character know that you are doing talking.
Finish Talking()
Void
Stops streaming microphone audio to the character.
Get Available Capture Device Names()
TArray<FString>
Returns all the available capture devices.
Get Microphone Volume Multiplier()
Void
Gets microphone volume multiplier.
Set Capture Device Name()
Boolean
Sets the capture device name.
Set Microphone Volume Multiplier()
Void
Sets the microphone volume multiplier.
Get Active Capture Device()
Void
Gets info about active capture device.
UConvaiChatbotComponent* ConvaiChatbotComponent
The character to talk to.
UConvaiEnvironment* Environment
Holds all relevant objects and characters in the scene including the (Player), and also all the actions doable by the character. Use the CreateConvaiEnvironment()
function to create and then use functions like AddAction(), AddCharacter(), AddMainCharacter()
to fill it up.
FString Text
Text to be sent to the character.
bool GenerateActions
Whether or not to generate actions (Environment has to be given and valid)
bool VoiceResponse
If true it will generate a voice response, otherwise, it will only generate a text response.
bool RunOnServer
If true it will run this function on the server, this can be used in multiplayer sessions to allow other players to hear the character's voice response.
bool StreamPlayerMic
If true it will stream the player's voice to other players in the multiplayer session, this is the same effect as voice chat.