S3M
The audio file you want to stream has the ScreamTracker 3 audio file format.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Field
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
S3M = 17
Remarks
Use this enumeration value to ensure the format type of the audio file has the ScreamTracker 3 audio file format. Use this audio type for files with the extension . If the audio file has a different format, Unity might not play the audio correctly.
.s3mExamples
// This script streams a ScreamTracker 3 audio file from the web. // First though you need to switch out the url to a valid url of a S3M audio file hosted on the web. // Attach this script to a GameObject. using UnityEngine;using UnityEngine.Networking;using System.Collections;public class AudioTypeExample : MonoBehaviour{ AudioSource audioSource; void Start() { // Add an AudioSource to your GameObject. audioSource = gameObject.AddComponent<AudioSource>(); StartCoroutine(GetAudioClip()); } IEnumerator GetAudioClip() { // Replace the string with where you host your audio file. string url = "https://www.example.com/screamtracker3sound.s3m"; // Stream audio, store it as an audio clip and play it. Make sure it has the S3M audio format. using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.S3M)) { yield return www.SendWebRequest(); if (www.result == UnityWebRequest.Result.ConnectionError) { Debug.Log(www.error); } else { AudioClip myClip = DownloadHandlerAudioClip.GetContent(www); audioSource.clip = myClip; audioSource.Play(); } } }}