Skip to content

Load Audio Clip from remote url, URI or local storage. Audio streaming, Audio Loading

License

Notifications You must be signed in to change notification settings

studentutu/UnityAsyncAudioClipLoading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loading async Audio clip or streaming audio clip

License

Requires Unity Editor 2017.4 +

Getting Started

Please refer to the sample usage sccript Example

See full example scene:

/Runtime/ExampleScene/PlayAudio.unity

Usage

var requestTask = AudioFromWebRequest.LoadAudioFrom(audiosource, url,headers,audioType,enableStreaming,minKbForStreaming,cancelationToken );

var requestWithAudio = await requestTask.Task.ConfigureAwait(true);

// Get ready clip to be used in Unity Audio Source
_audioSource.clip = requestWithAudio.AudioClip.AudioClip;
  • can be used both with local files (System.Uri that starts with file:///)
  • can only be used with Get requests and custom headers

License

Code released under the MIT License.