UnityWebRequestExt.LoadAudioClip Method
Loads an AudioClip asynchronously from an URI.
Namespace: UltimateXR.Extensions.Unity.IO
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Task<AudioClip> LoadAudioClip(
string uri,
CancellationToken ct = default
)
Parameters
- uri
- Type: System.String
Location of the audio clip - ct (Optional)
- Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the operation
Return Value
Type: Task(AudioClip)
Awaitable Task that returns the loaded audio clip
Exceptions
Exception | Condition |
---|---|
HttpUwrException | HttpError flag is on |
NetUwrException | NetworkError flag is on |
OperationCanceledException | The task was canceled using ct |
See Also
Reference
UnityWebRequestExt Class
UltimateXR.Extensions.Unity.IO Namespace