VoiPSampleRate

VoiPSampleRate

#Overview

name: VoiPSampleRate

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of VoiPSampleRate is to specify the sample rate used for voice over IP (VOIP) audio in Unreal Engine. This setting is crucial for determining the quality and performance of voice communication in multiplayer games or applications that utilize VOIP features.

This setting variable is primarily used by the Audio subsystem of Unreal Engine, specifically in the context of VOIP functionality. It is defined in the AudioSettings class, which is part of the Engine module.

The value of this variable is set in the AudioSettings class, which inherits from UDeveloperSettings. It can be configured through the project settings in the Unreal Engine editor, allowing developers to choose the appropriate sample rate for their VOIP needs.

VoiPSampleRate interacts with other audio-related variables and systems within the engine. For example, it’s used alongside other audio settings like DefaultAudioCompressionType and is part of the broader audio configuration for the engine.

Developers must be aware that the chosen VOIP sample rate affects both the quality of voice communication and the performance impact on the game or application. Higher sample rates provide better audio quality but require more bandwidth and processing power.

Best practices when using this variable include:

  1. Choose a sample rate that balances audio quality with performance requirements.
  2. Consider the target platforms and their network capabilities when selecting the VOIP sample rate.
  3. Test the VOIP functionality thoroughly with different sample rates to find the optimal setting for your specific use case.
  4. Be aware that VOIP audio is resampled to the application’s sample rate on the receiver side, which may impact overall audio quality and performance.
  5. Coordinate this setting with other audio-related configurations to ensure a cohesive audio experience in your game or application.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:255, section: [/Script/Engine.AudioSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/AudioSettings.h:170

Scope (from outer to inner):

file
class        class UAudioSettings : public UDeveloperSettings

Source code excerpt:

	/** Sample rate used for voice over IP. VOIP audio is resampled to the application's sample rate on the receiver side. */
	UPROPERTY(config, EditAnywhere, Category = "Audio", meta = (DisplayName = "VOIP Sample Rate"))
	EVoiceSampleRate VoiPSampleRate;

	/** Default audio compression type to use for audio assets. */
	UPROPERTY(config, EditAnywhere, Category = "Audio")
	EDefaultAudioCompressionType DefaultAudioCompressionType;

	/** The default compression quality (e.g. for new SoundWaves) */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioSettings.cpp:38

Scope (from outer to inner):

file
function     void UAudioSettings::AddDefaultSettings

Source code excerpt:

	bAllowPlayWhenSilent = true;
	DefaultReverbSendLevel_DEPRECATED = 0.0f;
	VoiPSampleRate = EVoiceSampleRate::Low16000Hz;
	NumStoppingSources = 8;
}

#if WITH_EDITOR
void UAudioSettings::PreEditChange(FProperty* PropertyAboutToChange)
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VoiceConfig.cpp:97

Scope (from outer to inner):

file
function     int32 UVOIPStatics::GetVoiceSampleRate

Source code excerpt:

	static FString DesiredSampleRateStr;
	
	if (GConfig->GetString(TEXT("/Script/Engine.AudioSettings"), TEXT("VoiPSampleRate"), DesiredSampleRateStr, GEngineIni))
	{
		if (DesiredSampleRateStr.Equals(TEXT("Low16000Hz")))
		{
			SampleRate = (int32)EVoiceSampleRate::Low16000Hz;
		}
		else if (DesiredSampleRateStr.Equals(TEXT("Normal24000Hz")))