Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by BlazeMote · Apr 22, 2016 at 07:20 AM · audiowebglstreamingdownloading

WebGL - Streaming of 'ogg' on this platform is not supported

I've got an .ogg file up on the server that I'd like to download and play at runtime. I've got some code that works in the editor, but doesn't work in a WebGL deploy. In the WebGL deploy, I get the following error:

Streaming of 'ogg' on this platform is not supported.

Well, I'm not trying to stream it. In fact I'd prefer for the audio to be fully downloaded before attempting playback.

Here's the code I'm testing with:

 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class test_dynamic_audio : MonoBehaviour
 {
     public Text txt_message;
 
     private AudioSource _source;
 
     // Use this for initialization
     IEnumerator Start()
     {
         string url;
 
         url = "http://www.domain.com/url/to/audio.ogg";
 
         _source = GetComponent<AudioSource>();
 
         yield return new WaitForSeconds(0.5f);
 
         WWW www = new WWW(url);
         yield return www;
 
         _source.clip = www.GetAudioClip(false, false, AudioType.OGGVORBIS);
 
         yield return new WaitForSeconds(0.5f);
         
         _source.Play();
     }
     
     // Update is called once per frame
     void Update()
     {
         txt_message.text = "LOADING...";
 
         if (_source.clip != null)
         {
             txt_message.text = "LOADED.";
 
             if (_source.clip.isReadyToPlay)
             {
                 if (_source.isPlaying)
                 {
                     txt_message.text = "PLAYING.";
                 }
             }
         }
     }
 }

Any ideas on how to properly download audio and play it in WebGL?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by BlazeMote · Apr 26, 2016 at 07:56 AM

So after further trial and error, we determined that .ogg files don't download properly at runtime in WebGL deploys, but .mp3 files do. Converting all of our .oggs to .mp3s have resolved this issue.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wmadwand · Oct 04, 2017 at 06:24 AM 0
Share

Talking of oddities, I've faced with exactly the same issue. And that's inspite of "The data must be an audio clip in Ogg(Web/Standalones), $$anonymous$$P3(phones) or WAV" from the official docs (https://docs.unity3d.com/ScriptReference/WWWAudioExtensions.GetAudioClip.html). Guess something was missed for some reason. Thanks for the solution!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Mute video player audio in WebGL not working 2 Answers

Unity iPhone: Audio "stream from disc" memory usage 1 Answer

audio stream current length 1 Answer

How to have www streaming to work with a radio station? 1 Answer

Type error on loading audio from URL in WebGl. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges