Search Unity

What format is needed to stream audio on Windows 10

Discussion in 'Windows' started by monark, Nov 18, 2015.

  1. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I'm trying to stream audio in a Windows 10 universal app and no matter what format I try I get an error saying

    I've tried mp3, wav and ogg all with the same result.

    What format does one need to use to get audio streaming working on Windows?
    There doesn't appear to be anything in the help about it.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    ogg should work - how did you encode the stream?
     
  3. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    using ffmpeg

    using .mp3's as input

    These work fine in the webplayer version btw.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    For the sake of safety, can you add -vn flag?
     
  5. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Same error
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Any chance you could make a minimum project that demonstrates the issue so we could look at it?
     
  7. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
  8. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Doh! School boy error. I forgot that the GetAudioClip function also needs the type passing and hadn't updated it from .mp3 which I tried first. Nothing to see hear, move along....
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I'm glad you figured it out :).
     
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    With latest 5.3.1 and latest WINDOWS 10 SDK we have some issues with opening through www.GetAudioClip(localPersistentPath)

    We are in editor and seems like the same issue is in VS2015 Update 1 but there we just have like minute hang for each audio.

    Any idea?

    Error: Cannot create FMOD::Sound instance for resource (B, (Operation could not be performed because specified sound/DSP connection is not ready. )
    UnityEngine.WWW:GetAudioClip(Boolean, Boolean, AudioType)
    HutongGames.PlayMaker.Actions.SpeechBubblePRO:OnUpdate() (at Assets/Foriero/SpeechBubblePRO/Scripts/SpeechBubblePRO.cs:358)
    HutongGames.PlayMaker.FsmState:OnUpdate() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:255)
    HutongGames.PlayMaker.Fsm:UpdateState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2170)
    HutongGames.PlayMaker.Fsm:Update() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1425)
    PlayMakerFSM:Update() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:431)
     
  11. judgementAlex

    judgementAlex

    Joined:
    Sep 9, 2013
    Posts:
    28
    Also seeing this issue on 5.3.3f1 on Windows 10.

    Code (CSharp):
    1. Error: Cannot create FMOD::Sound instance for resource ȜB, (Operation could not be performed because specified sound/DSP connection is not ready. )
    2. UnityEngine.WWW:GetAudioClip(Boolean, Boolean, AudioType)
    3. <Speak>c__Iterator5:MoveNext() (at Assets/Scripts/Speaker.cs:110)
    Here's the function call I'm using:

    Code (CSharp):
    1. WWW stream = new WWW ("file://" + path);
    2. while (!stream.isDone)
    3. yield return null;
    4. AudioClip voiceAudio = stream.GetAudioClip(true, true, AudioType.WAV);
     
    Last edited: Mar 13, 2016
  12. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    For one thing, make sure path uses forward slashes.
    Also check for error state in stream.
     
  13. judgementAlex

    judgementAlex

    Joined:
    Sep 9, 2013
    Posts:
    28
    Path is formatted as such: "file://C:/Users/alex/AppData/Local/Temp/The Nevermind/Odyssey Virtual/tmpvoice1136059136.wav"
    Stream error returns: "Couldn't open file /Users/alex/AppData/Local/Temp/The Nevermind/Odyssey Virtual/tmpvoice1136059136.wav", though these files exist with the correct permissions. Previously, these files imported fine but only recently starting throwing these errors. I don't think it was the engine update, since it was working under 5.3.3f1. I think it might have been a VS update or Windows update that broke this.
     
  14. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    The only suspicion I have is spaces in URL. What if you encoded them with %20 ?
     
  15. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Shouldn't you have three slashes after file protocol. Like this:
    Code (csharp):
    1.  
    2. file:///C:/Users/alex/AppData/Local/Temp/The Nevermind/Odyssey Virtual/tmpvoice1136059136.wav
    3.  
     
    dvs_code likes this.
  16. judgementAlex

    judgementAlex

    Joined:
    Sep 9, 2013
    Posts:
    28
    Ah! Thank you. Funny that two slashes worked fine up until recently.

    Thanks for the speedy support!
     
  17. CNR-EpiTel

    CNR-EpiTel

    Joined:
    Aug 23, 2018
    Posts:
    12
    Camera side-Sound shows up in mixer but not audible in reality whatsoever.PNG Sound shows up in mixer but not audible in reality whatsoever.PNG
    Tomas, I need to fix a major glitch in unity audio and it is repeatedly occuring for no reason as a failed compatibility with windows 10 ,unlike any other app on the same system..

    Steps: setup a basic audio listener on your camera add resonance audio , add a game object with a basic clap noise, make sure it is set to spatialise,. Press play: you will see that the mixers show PROFOUND activation of noise from the clapping but NONE of it is coming through Windows. That means it is working in unity scene but not recognisable to the device drivers in Windows 10.


    If I missed a post where the error was solved,I would be happy to follow that.
    Do you know of any?
    This is a problem I need to resolve urgently.
    Any help would be enormously appreciated.