AudioClipExt.FromFile Method
Asynchronously reads and loads an AudioClip into memory from a given uri
Namespace: UltimateXR.Extensions.Unity.Audio
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Task<AudioClip> FromFile(
string uri,
CancellationToken ct = default
)
Parameters
- uri
- Type: System.String
Full path for AudioClip file - ct (Optional)
- Type: System.Threading.CancellationToken
The optional cancellation token, to cancel the task
Return Value
Type: Task(AudioClip)
Loaded AudioClip
Exceptions
Exception | Condition |
---|---|
HttpUwrException | HttpError flag is on |
NetUwrException | NetworkError flag is on |
OperationCanceledException | The task was canceled using ct |
See Also
Reference
AudioClipExt Class
UltimateXR.Extensions.Unity.Audio Namespace