AudioUtil
Util library for dealing with the VoiceChatService AudioAPI
AudioUtil.CreateWire(Source, Target, Parent?)
Creates a wire connecting an audio stream to an audio receiver
Parameters:
- Source: An Instance Emitting an Audio Stream
- Target: An Instance Receiving an Audio Stream
- Parent: Any Instance
Returns:
- Wire: The wire connecting the Source to the Target
AudioUtil.GetPlayersAudioDeviceInput(Player, ShouldYield)
Returns a player's AudioDeviceInput
Parameters:
- Player: The player whose AudioDeviceInput you're trying to get
- ShouldYield: If the function should yield for up to 10 seconds while waiting for the Target Player's AudioDeviceInput to Replicate
Returns:
- AudioDeviceInput?: The player's AudioDeviceInput, if it exists
AudioUtil.GetVoiceConfigForTeam(Team)
Returns the voice config for a team if it exists
Parameters:
- Team: The team whose voice config we are trying to fetch
Return:
- Configuration?: The voice config for the team, if it exists
AudioUtil.IsVoiceEnabledForTeam(Team)
Returns true if there is no Instance parented to the team named 'VoiceDisabled', else false
Parameters:
- Team: The team to check
Returns:
- boolean: true if voice enabled, else false
AudioUtil.GetVoiceTypesForTeam(Team)
Parameters:
- Team: The team to get the voice types from
Returns:
- Folder: A folder containing all the voice types for the team
AudioUtil.GetVoiceTypesAsStringArrayForTeam(Team)
Returns a string array of the voice types for the given team
Parameters:
- Team: The team to get the voice types from
Returns:
- { string }: A string array of the voice types
AudioUtil.GetVoiceEffectsForVoiceType(VoiceType)
Returns the children under the given voice type, assuming they're all valid audio effects
Parameters:
- Team: The team that holds the VoiceType instance
- VoiceType: The VoiceType with the VoiceEffects you are trying to get
Returns:
- { Instance }: A list of the Voice Effects
AudioUtil.ConnectWiresForVoiceEffects(Source, Target, Team)
Generates wires for all the voice effects in the team's VoiceEffects folder
Parameters:
- Source: The initial audio stream, presummably an AudioDeviceInput
- Target: An AudioDeviceOutput that gets connected as the TargetInstance of the final wire
- Team: The team the LocalPlayer is current apart of
Returns:
- { Wire }: The wires generated