Description
The Carpet
field is a member of the AudioSurface
enumeration in the Sandbox namespace. It represents a surface type with acoustic properties similar to that of a carpet. This affects how sound interacts with the surface, such as absorption and reflection characteristics.
Usage
Use the AudioSurface.Carpet
field when you need to specify or check for a surface type that behaves acoustically like a carpet. This can be useful in scenarios where sound design and environmental audio effects are important, such as in game development or simulation environments.
Example
// Example of using AudioSurface.Carpet
public class SoundManager : Component
{
public void PlayFootstepSound(Vector3 position, AudioSurface surface)
{
string soundPath = "";
switch (surface)
{
case AudioSurface.Carpet:
soundPath = "sounds/footsteps/carpet.ogg";
break;
// Handle other surfaces...
}
Sound.FromWorld(soundPath, position);
}
}