Sets the maximum latency in milliseconds that is needed by the target platform to buffer soundfiles from the storage medium.

Namespace: psai.net
Assembly: psaiCoreDotNet (in psaiCoreDotNet.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public PsaiResult SetMaximumLatencyNeededByPlatformToBufferSounddata(
	int latencyInMilliseconds
)

Parameters

latencyInMilliseconds
Type: System..::..Int32
the buffering latency in milliseconds

Return Value

Type: PsaiResult
PsaiResult.OK if successful

Remarks

As there is currently no mechanism within Unity to check the actual latency needed by the target device to buffer and play back a sound, we solve this by providing a maximum latency value that should be enough for each given platform, and we delay all playback by this value. Please note that these value not only depends on the target platform, but also on the system specifications (like weaker/older mobile phones usually need more time to buffer), but also on the storage media (optical drives take much longer that harddrives). We provide default values for all the platforms supported by Unity that will be set automatically and will work in most cases. However you may choose to finetune these settings. Lower latency settings will improve overall reactivity of your soundtrack, but might result in dropouts.

See Also