Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Radio PRO - MP3 and OGG-streaming solution

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, Jun 18, 2015.

  1. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    Stefan-Laubenberger likes this.
  2. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Wow, your game looks great!
    If you're happy with "Radio", please rate/review it in the store.

    All the best with "VLR"!


    So long,
    Stefan
     
  3. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    Managed to test yesterday. Left a review. Great product:)

    Edit - yesterdays store version that is
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hey Doc

    Thank you very much for your review!
    If you encounter any problems, just let me know.


    So long,
    Stefan
     
    docsavage likes this.
  5. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    Deserved - Great product:)
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    We also made a little video about the supported platforms:

     
  7. goodxiexin

    goodxiexin

    Joined:
    Oct 11, 2016
    Posts:
    1
    Hi Stefan-Laubenberger
    I purchased Radio Pro and it is fantastic. I wonder if there is any way we can use it for podcasts. Thanks
     
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi goodxiexin

    What exactly do you mean by "Podcasts"? MP3 or OGG-files on a server?
    If that's the case, it can easily be done - just change the "Cache Memory Size" to the maximal size of your files, e.g. if your largest file is 16MB, change it to 16384.

    I hope this helps!


    So long,
    Stefan
     
  9. eldron2323

    eldron2323

    Joined:
    Aug 13, 2015
    Posts:
    2
    Hi Stefan! I'm interested in using this for my game. I have a question though. Do you know if your asset will work on consoles like PS4 or XBox? Thanks!
     
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Eldron

    Thank you for your interest in "Radio"!

    I'm 99% sure that it will work since the encoding is done in pure C#-code and this is working under PS4/XBox.
    But we don't own a PS4 or XBox-development kit so we can't test it.

    It would be nice if you could try it and let me know. If it doesn't work I will issue a refund.


    So long,
    Stefan
     
  11. eldron2323

    eldron2323

    Joined:
    Aug 13, 2015
    Posts:
    2
    Thanks for the fast reply! I will relay this with me team and then let you know what happens if we end up getting it.
     
  12. McSwan

    McSwan

    Joined:
    Nov 21, 2013
    Posts:
    129
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi McSwan

    Unfortunately, Radio doesn't support HLS until now.
    We will evaluate this feature for an upcoming release but don't expect a solution in the near future.

    Cheers
    Stefan
     
  14. Vontarga

    Vontarga

    Joined:
    Oct 14, 2014
    Posts:
    99
    Hi Stefan,

    I am following up on our earlier conversation. We have decided to go with "Radio," and are ready to add it to our project now.

    It is important to clarify something. We do NOT want 3D. We want 2D only. We want the music to play at full volume or not at all. MY head coder tells me it must be 2D to implement this effect.

    1. Does Radio support 2D?

    2. Can we have different stations playing in different locations within the same scene? For example, Rock music in a Rock'n'Roll bar, but different music in a house at another location?

    3. If so, how precisely can the music be controlled. By this I mean, can we limit it pretty closely to the shape of the building or other area where we want it?

    4. Do I add this and set parameters when I am building the scene, or do my technical people add it after we are on the server?

    Thank you. :)
     
  15. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hello again

    I try to answer your questions:

    1. Yes, we use a normal AudioSource from Unity, which has spatial blend settings for 2D until 3D
    2. Yes, you can play as many stations as you want - the only limit is the Internet bandwidth :)
    3. See AudioSource above, there you can add Reverb-zones etc.
    4. That's up to you and how you design your application
    I hope this helps.

    Cheers
    Stefan
     
    Vontarga likes this.
  16. Vontarga

    Vontarga

    Joined:
    Oct 14, 2014
    Posts:
    99
    Thank you, Stefan. This should work perfectly for us. :)
     
  17. Jaacob

    Jaacob

    Joined:
    Apr 1, 2015
    Posts:
    1
    Hey Stefan.

    I'm looking into your plugin, testing it for future use in our game(s). It seems working fine, I just found and issue:
    If I run the app in Editor, start playing some radio, then update source code and focus back to editor (which is still running and playing radio stream), the recompilation process crashes Unity.
    Happens e.q. in Demo03-NoUI scene - just run the scene, play the radio and force editor to recomplile.

    It only occurs while the radio is playing. If I stop playback before Unity recompilation, it works just fine.
    Crash log says that: Unity.exe caused an Access Violation (0xc0000005) in module Unity.exe at 0033:410e5a1b.

    Used Unity 5.4.0p4, didn't tested other versions yet.

    We usually use script in our games, that forces editor to stop play mode once it starts recompiling. It's similar to this Benakin486's solution and it fixes the crashes - but I still guess you should look into it. My guess is some mishaps around threading and memory management, but I didn't dig in your source code just yet.

    Another minor issue is, that demo scenes 02, 06 and Mobile have wrong SimplePlayer script references on SimplePlayer gameobjects. Not a big deal, but still would've been nice if you clean it up, right now theese demos doesn't work "out of the box".. ;)

    Cheers!
     
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Jaacob

    Thank you for pointing this out!

    We already added some checks to stop playback before compiling but it seems not to work good enough and we will improve that in the next release.

    We will also look into the other issue with the missing references and update it.
    I think the problem are the prefabs which are different in the dll- vs. source-code-version...
    This will also be fixed in the next release.

    Have a nice day!


    So long,
    Stefan
     
  19. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Hi all,
    I added 'Radio' to an Online Multiplayer Cars Demo using Photon Cloud with good results.No Lag with game or 'Radio'.
    Well Done Stefan!
    Legals:
    Being unsure of the legal use of preset stations in 'Radio', I wonder if just supplying 'Radio' and let the user input the station of their choice at runtime would be a work around reliving responsibility off the programmer.
    Thanx for the fine asset,
    Steve
    Video on this page:
    http://stvster.com/cars/
     
    Stefan-Laubenberger likes this.
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Steve

    Thank you for the kind words!
    The videos for your game are looking great! :)

    About the legals:
    You're on the safe side if you let the users enter the station url on their own.
    On the other hand, it's not very user-friendly... The other possibility is to directly ask the stations you would like to include - they're probably happy if somebody listen to them ;-)

    If you like our product/support, please rate us at the store. Or even better, write a review - it's very much appreciated.

    Have a nice day!


    So long,
    Stefan
     
    stvster likes this.
  21. JohnTomorrow

    JohnTomorrow

    Joined:
    Apr 19, 2013
    Posts:
    135
    Can this asset stream non-radio ogg or mp3 files?
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Last edited: Jun 25, 2018
  23. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Hi and Thanx for the kind words.
    I setup a Shoutcast station but a little confused on how to set it up in 'Radio'.I have mp3's in my playlist and SCast streams m3u + pls i believe.I'll keep trying to fix this but if you have a suggestion I'm all EARS(pun intended).
    My Scast urls are: http://s37.myradiostream.com:8668 for admin and the player url is http://myradiostream/37/8668.
    Thanx,
    Steve

    EDIT: Got it working with SimpleUI. :)
     
    Last edited: Mar 11, 2017
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    I'm glad it's working! :)

    Cheers
    Stefan
     
  25. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Thanx for the Update.
    Maybe it'll make my Band sound better on my Station :)
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Probably you should add some audio filters like distortion :p
     
  27. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Good idea since I'm ALREADY distorted. :)
     
    Stefan-Laubenberger likes this.
  28. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Hi, I love the crosstales radio plugin, seems very solid in all testing up to now.

    Pleased to see it spatializes nicely even in VR with GVRAudioSource extension to ordinary AudioSource, you get a stereo soundfield that's spatialized right where the virtual speakers are, awesome!

    I just finished integrating it (and a shoutcast directory browser) into my game, here's a quick-n-dirty dev video, showing off spatialization:


    Quick Q :
    At the moment to switch channels on my radio object 'cRadio' I'm doing this:

    [1]cRadio.Stop()
    [2]Poll cRadio.isAudioPlaying() until false
    [3]Wait 1 sec.
    [4]Set station and call cRadio.Play()

    I'm thinking maybe instantiate 2 radio objects and toggle between them instead of the hack at step 3, maybe that's how your manager class works? But I'm worried about eating too much RAM on weaker mobile targets, what would you recommend I do?

    I'm not worried about it taking some secs to switch but I would like to know when it's OK to move to [4] without hacky wait at [3].
     
    Stefan-Laubenberger likes this.
  29. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi

    There is no need for hacky stuff with our plugins ;).

    So, the first solution:
    Simply listen to the event " OnPlaybackEnd" from "RadioPlayer" instead of waiting.

    Second solution:
    Create a list of radio stations and use the "RadioManager" and "SimplePlayer" together with "RadioPlayer". Take a look at scene "02 - PlayStations". With this approach, you can call "Next" or "Previous" on the "SimplePlayer".

    For more details, please take a look at the API.
    I hope this helps.


    Cheers
    Stefan
     
    SiliconDroid likes this.
  30. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Thanks for the info Stefan,

    Regarding Solution 1:
    Yes registering a callback handler for the OnPlaybackEnd delegate does work, same as polling isAudioPlaying in effect.

    The problem is though; if I try and start new station after receiving OnPlaybackEnd like this:

    oRadioPlayer.Station = oNewStation;
    oRadioPlayer.Play();

    The new station will not start playing, I have to wait some time before I can do that.

    The required wait time through experimentation is not constant, depending on some hidden internal state of RadioPlayer.

    At the moment I wait for 1 second after seeing it stop and then play seems to always work. I then poll isAudioPlaying just to make sure, so I have covered all cases and that works fine and robustly for me. But it would have been easier for me to know when the RadioPlayer is definitely ready to start playing a new station.

    Ideally RadioPlayer API should be more permissive and autonomous: If API user calls Play() the RadioPlayer should handle all cases of that internally: check if new station has been set, if yes then stop old station and start new requested one. If station not changed, just resume or carry on playing.

    No mad rush on implementing that though, I just thought I would pass on my experience as your API user.

    Oh and Kudos for building it all in mono compatible C#.

    Best, Fraser.
     
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Fraser

    Imho, "SimplePlayer" is exactly what you are looking for (solution 2)...

    Anyway, here is a Unity-package with only the "RadioPlayer" (without waiting etc.).
    Let me know if this solves the issues.


    Cheers
    Stefan
     

    Attached Files:

  32. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Hi, Stefan, The package you linked exhibited the same problem when I put GVRAudioSource on object, so that's the issue, external to your radio and not the fault of the radio at all!

    Regardless... I've got it all working solidly now with GVRAudioSource using method I mention above.

    Thx for a great asset!:cool:

    Anyone reading this thinking of purchasing.... don't hesitate, solid asset, worth every penny!
     
    Last edited: Apr 2, 2017
    Stefan-Laubenberger likes this.
  33. michael_lightweave

    michael_lightweave

    Joined:
    Oct 29, 2016
    Posts:
    3
    Hi Stefan,

    We are building a mobile application for use on location at a sports event, and would like the ability to stream a custom commentary stream live at the event (ogg stream). I have noticed your plugin supports both iOS and Android. Does it allow for playing the audio in the background (when the device is locked).
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Michael

    Unity-apps can't work in the background on mobiles out of the box. :(
    We will probably provide native hooks for mobiles in the future, but this is A LOT of work! If you really need an audio app that plays "always" (e.g. like Spotify), you should consider using a native app instead Unity for the device...


    Cheers
    Stefan
     
  35. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    there no way to keep playing the radio streaming, out of the box? i need that
     
  36. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    We also need that, but Unity doesn't work in the background on mobiles... :(
    You have to stick with a native implementation or find a hack to solve this requirement.


    Edit:
    We added a background-tutorial in the official package!
     
    Last edited: Jul 12, 2017
  37. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    did you now which programa for IOs and Android, are available to stick native implementation?
     
  38. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Last edited: Jun 25, 2018
    pixelsteam likes this.
  40. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Can you let us know what the new features are in Radio 2.7.0
     
  41. radimoto

    radimoto

    Joined:
    Aug 23, 2012
    Posts:
    257
    Hi Stefan, I updated to 2.7.1a and have a minor issue on 2017.1.0b9

    Assets/crosstales/Radio/Plugins/Editor/SetupResources.cs(44,29): error CS0103: The name `Config' does not exist in the current context

    As a workaround I just comment SetupResources.cs lines 44 and 45 and it compiles OK

    // if (Config.DEBUG)
    // Debug.Log("File moved: " + file);
     
  42. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi

    Thank you for pointing this out - we also found this issue and will release a fixed and updated version soon.
    Meanwhile, the code for "SetupResources.cs" should look like this;

    Code (CSharp):
    1. if (Util.Config.DEBUG)
    2.    Debug.Log("File moved: " + file);
    The namespace "Util" was missing...

    Sorry for the inconvenience and have a nice weekend!


    Cheers
    Stefan
     
  43. tylersmith-vr

    tylersmith-vr

    Joined:
    Dec 10, 2016
    Posts:
    3
    Hi Stefan and team

    I love the idea of this asset and have been using it successfully until recently.

    What i want to do is stream a chosen radio station to multiple game objects or "radioplayers" at once but only have one radioplayer if that makes sense? Basically we are running quiet a CPU and GPU intensive VR module and are looking to create a 3D surround sound effect (E.g. 4 speakers in each corner of the room).

    The issue we are having at the moment is that each radio player needs its own Radio Player script and given the run time constraints we have with respect to streaming each radio, as soon as we add multiple radio players each with their own streaming delays, as you can imagine, we experience drops in frame rate and other undesired side effects.

    Thus to my question,
    Is there anyway to have one say radio player and then pipe the streamed audio that is dynamically shows up as an audio.clip (in the audio source component) to multiple audio sources on different game objects?

    We did try simply assigning the generated audio.clip to multiple audio sources at run time

    E.g.
    cloneAudio = Clone.GetComponent<AudioSource>();
    cloneAudio.clip = originalAudio.clip;

    However this did not work. Any ideas or suggestions would be appreciated given that having the same radio play at multiple locations would seem like a common request.

    Thanks for your time
     
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Tyler

    Consider it done but it wasn't that easy...
    Just send me your invoice and I give you the version that fulfills your desire ;)


    Cheers
    Stefan
     
  45. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    P.S: we've just updated the demo-apps to show the new function. It's demo number 7 :)

    Windows
    Mac
    Linux
     
    Last edited: Jun 21, 2017
  46. tylersmith-vr

    tylersmith-vr

    Joined:
    Dec 10, 2016
    Posts:
    3
    Demo number 7 with loudspeakers is exactly what i was looking for. After implementing and testing it on the HTC Vive, the results are perfect thus far.

    From the team at Unleashed-VR (www.unleashed-vr.com), thank you for your timely responses and your amazing turn around time. Amazing! Both the asset and the customer service.
     
    Stefan-Laubenberger likes this.
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Tyler

    I'm happy it's working for you!
    If you have more suggestions or questions, just drop me an email.


    So long,
    Stefan
     
  48. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Is the current price the sale price?
     
  49. AndreaFricke

    AndreaFricke

    Joined:
    Dec 6, 2013
    Posts:
    3
    Hi Stefan!
    We are interested in purchasing your Plugin. It may be a simple question, but nonetheless: Are we allowed to change your UI that is visible in the screenshots and in the standalone demo?
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Andrea

    Thank you for your interest in "Radio"!

    Yes you can, the whole asset incl. UI is free to re-use in your own projects!
    If you like our asset, it would be very nice if you could mention us hidden in the "About", far far down the list of people involved in your awesome game ;)


    Cheers
    Stefan
     
    Last edited: Jul 31, 2017
    AndreaFricke likes this.