SpatialAudioZone
Sound insulation zone settings.
class SpatialAudioZone {
const SpatialAudioZone(
{this.zoneSetId,
this.position,
this.forward,
this.right,
this.up,
this.forwardLength,
this.rightLength,
this.upLength,
this.audioAttenuation});
@JsonKey(name: 'zoneSetId')
final int? zoneSetId;
@JsonKey(name: 'position')
final List<double>? position;
@JsonKey(name: 'forward')
final List<double>? forward;
@JsonKey(name: 'right')
final List<double>? right;
@JsonKey(name: 'up')
final List<double>? up;
@JsonKey(name: 'forwardLength')
final double? forwardLength;
@JsonKey(name: 'rightLength')
final double? rightLength;
@JsonKey(name: 'upLength')
final double? upLength;
@JsonKey(name: 'audioAttenuation')
final double? audioAttenuation;
factory SpatialAudioZone.fromJson(Map<String, dynamic> json) =>
_$SpatialAudioZoneFromJson(json);
Map<String, dynamic> toJson() => _$SpatialAudioZoneToJson(this);
}
Properties
- zoneSetId
- ID of the sound insulation zone.
- position
- The spatial center point of the sound insulation zone. This parameter is an array of length 3, representing the coordinates in the forward, right, and up directions.
- forward
- Unit vector in the forward direction starting from
position. This parameter is an array of length 3, representing the coordinates in the forward, right, and up directions. - right
- Unit vector in the right direction starting from
position. This parameter is an array of length 3, representing the coordinates in the forward, right, and up directions. - up
- Unit vector in the upward direction starting from
position. This parameter is an array of length 3, representing the coordinates in the forward, right, and up directions. - forwardLength
- Assuming the sound insulation zone is a cube, this represents the length in the forward direction, in game engine units.
- rightLength
- Assuming the sound insulation zone is a cube, this represents the length in the right direction, in game engine units.
- upLength
- Assuming the sound insulation zone is a cube, this represents the length in the upward direction, in game engine units.
- audioAttenuation
- Sound attenuation coefficient when users inside and outside the sound insulation zone communicate. Value range: [0,1]:
- 0: Broadcast mode. Volume and timbre do not attenuate with distance.
- (0,0.5): Weak attenuation. Slight attenuation of volume and timbre during transmission. Sound travels farther than in real environments.
- 0.5: Simulates real-world volume attenuation. Equivalent to not setting the
audioAttenuationparameter. - (0.5,1]: Strong attenuation (default is 1). Rapid attenuation of volume and timbre during transmission.