Skip to content

Commit

Permalink
com.utilities.rest 2.4.4 (RageAgainstThePixel#60)
Browse files Browse the repository at this point in the history
- updated com.utilities.extensions -> 1.1.14
- updated docs
- updated workflow
  • Loading branch information
StephenHodgson committed Dec 30, 2023
1 parent 26d03c5 commit 99687b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Documentation~/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ var audioClip = await Rest.DownloadAudioClipAsync("www.your.api/your_file.ogg",

if (audioClip != null)
{
// assign it to your audio source
audioSource.clip = audioClip;
// assign it to your audio source
audioSource.clip = audioClip;
audioSource.PlayOneShot(audioClip);
}
```
Expand All @@ -208,9 +208,10 @@ Streams an audio file from disk or remote resource as soon as enough data has be

> Unsure if this is working correctly as Unity doesn't seem to respect streaming when setting [`DownloadHandlerAudioClip.streamAudio`](https://docs.unity3d.com/ScriptReference/Networking.DownloadHandlerAudioClip-streamAudio.html) to true.
> Seems to work better for local files on disk than remote resources.
> Seems to only work for mp3 files.
```csharp
var audioClip = await Rest.StreamAudioAsync("local/path/to/your_file.ogg", AudioType.OGGVORBIS, onStreamPlaybackReady =>
var audioClip = await Rest.StreamAudioAsync("local/path/to/your_file.mp3", AudioType.MPEG, onStreamPlaybackReady =>
{
audioSource.PlayOneShot(onStreamPlaybackReady);
});
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.Rest",
"description": "This package contains useful RESTful utilities for the Unity Game Engine.",
"keywords": [],
"version": "2.4.3",
"version": "2.4.4",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",
Expand All @@ -16,7 +16,7 @@
"url": "https://github.com/StephenHodgson",
"dependencies": {
"com.utilities.async": "2.1.1",
"com.utilities.extensions": "1.1.13",
"com.utilities.extensions": "1.1.14",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
Expand Down

0 comments on commit 99687b7

Please sign in to comment.