Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Radio PRO - MP3 and OGG-streaming solution

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

  1. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Please open a new, empty scene and delete the folder "Assets/Plugins/crosstales".
    Then re-import the asset.

    Does that help?


    Cheers
    Stefan
     
  2. WsdServers

    WsdServers

    Joined:
    Jan 28, 2017
    Posts:
    15
    Never mind, rebuilding the library fixed the problem :)
     
    Stefan-Laubenberger likes this.
  3. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    504
    Does the radio pro handle DTS Sound streaming or other surround sound codecs ?
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Radio supports MP3 and OGG as streaming sources.
    MP3 has afaik only support for 2 channels, but I'm unsure about the capabilities for OGG.

    However, Radio is clearly intended for mono or stereo sources and was never tested with multichannel sources.


    Cheers
    Stefan
     
  5. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    Hi Stefan,
    I've gotten a lot of errors exactly after i imported this assets:

    How can i make these errors disappear?

    Keith
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi Keith

    Have you updated the version or was it a fresh install?
    Please make sure you delete the whole "crosstales"-folder under "Assets/Plugins" and re-install the asset.

    Does that solve the issue?


    So long,
    Stefan
     
  7. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20

    Yeah It was a fresh install but it's solved now, it worked!
    Thanks!
     
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    What was the problem?
     
  9. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    The problem was that i had a bunch of errors right after i imported this asset and i didn't know how to fix those errors (as shown in the picture above). Deleting the whole crosstale folder and re-installing it like you suggested made those errors disappear.
     
    Stefan-Laubenberger likes this.
  10. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    interesting
     
    Stefan-Laubenberger likes this.
  11. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    Hi @Stefan-Laubenberger , I purchased this asset and am getting major issues under a fresh URP project in 2021.1.7.

    Namely, many of the 3rd party demos having missing scripts, as well as the 04-3D Audio scene. I suggest you verify them (3/4 of them had major or fatal errors) -- I suspect asset UUIDs got changed?
     
  12. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi Drew

    That should not be the case - is the "UI.unitypackage" from "Plugins\crosstales\Common\Extras" extracted? If not, please import it manually.

    About the "04-3D"-scene: you have to install the character-controllers from "Standard Assets" (an asset from Unity).

    Does that help?


    So long,
    Stefan
     
  13. radioonlineluisteren

    radioonlineluisteren

    Joined:
    Jun 21, 2021
    Posts:
    1
    RadioOnlineLuisteren.nl is a website that provides a lot of the most popular online radio stations of 2021. FM radio is suitable for all your devices, experience it now.
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Thanks for the overview!

    It would be helpful if your site would provide the streaming URL for every station - this way they could be used in our Radio.
     
  15. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    247
    Hello

    can use for video games like gta for simulate radio in the vehicules?

    there isn't legal issues?
     
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
  17. Adrian_pro

    Adrian_pro

    Joined:
    May 23, 2013
    Posts:
    26
    Hi, I am trying to integrate for a game a test as an online radio streaming from https://radiolize.com/.
    He is using it on the website so it is working fine, but when I try to use it with the Radioplyer I get this weird error
    "No more data to read after 0:00! Please restart this station or choose another one"
    or
    "Only MP3 with layer 3 specs is supported!"
    or
    "Only MP3 with layer 3 specs is supported! MPEG-1 (Audio Layer III) allows the following sample rates: 32kHz, 44.1kHz and 48kHz!
    "

    There are any specific links that work? Is there a certain encoding option?
    I have tried some other stations and they work.

    Am I doing something wrong?
     
    JoeStrout likes this.
  18. Stefan-Laubenberger

    Stefan-Laubenberger

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

    I can't say for sure, but it looks like the streams are non-standard MP3 encoded.
    Can you please send me an example stream-url?


    Cheers
    Stefan
     
  19. Adrian_pro

    Adrian_pro

    Joined:
    May 23, 2013
    Posts:
    26

    Is there a way I can test it? A validator? This could be an interesting tool :)

    Here is the naughty radio link :): https://s51.radiolize.com/radio/8150/radio.mp3

    Thank you
     
  20. Stefan-Laubenberger

    Stefan-Laubenberger

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

    The issue is that the stream is AAC encoded:
    upload_2021-7-8_1-9-31.png

    Radio "only" plays MP3 and OGG-streams.


    Cheers
    Stefan
     
  21. Adrian_pro

    Adrian_pro

    Joined:
    May 23, 2013
    Posts:
    26
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
  23. adrian-taylor09

    adrian-taylor09

    Joined:
    Dec 22, 2016
    Posts:
    53
    Hi there, just wondering if there is anyway to validate a radio URL without playing it? My use case is as follows: User A inputs a radio station URL for other users in the game to listen to. Before I let them upload this URL I want to check that it is valid.
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi Adrian

    You could use our string extension methods "CTisWebsite" and "CTisIPv4" to verify if the string is a valid url.
    BUT this won't tell you if it's an actual radio station, something like "unity.com" would pass the test of those methods...
    To be sure, you have to play the entered station (e.g. muted for a few seconds) and if it doesn't fail, you will know it's an actual radio station.

    I hope this helps you further.


    Cheers
    Stefan
     
    adrian-taylor09 likes this.
  25. adrian-taylor09

    adrian-taylor09

    Joined:
    Dec 22, 2016
    Posts:
    53
    I'm having a weird issue after upgrading my project to Unity 2020.3.22f1 (latest LTS release)
    when I start a radio station, the audio plays, but it plays the first 1 or two seconds on repeat?!

    It's giving me an audio seizure!
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi Adrian

    I just did an extensive test with Unity 2020.3.19 and Radio 2021.2.4 and can't confirm the issue on my side.
    Can you please send me the Radio station which causes the described behaviour in your case?


    Regards
    Stefan
     
  27. adrian-taylor09

    adrian-taylor09

    Joined:
    Dec 22, 2016
    Posts:
    53
    Thanks Stefan,

    It was happening with all radio stations that I tried. However, restarting Unity seemed to fix the issue! Probably should have tried that first!
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    No problem, I'm happy it works now for you!
    If you like our asset/support, please consider leaving a review in the store.
     
  29. Jasinka

    Jasinka

    Joined:
    Oct 18, 2016
    Posts:
    50
    Hello, have you plans support ACC format in future? Thanks.
     
    RoyalCoder likes this.
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi!

    We would like to support AAC, but afaik there is no C# codec available (since the codec supports DRM and is a proprietary solution).

    Maybe it would work under Windows and with some native libraries also for Android, but the effort is quite substantial.
    MP3/OGG is still widely support by tens of thousands of radio stations, so support for AAC is not something we have planned in the near future.


    Cheers
    Stefan
     
    RoyalCoder likes this.
  31. WizardGameDev

    WizardGameDev

    Joined:
    Jul 25, 2012
    Posts:
    62
    Demo app plays station fine in the editor but when I build for android I can't get any stations to play at all.

    The error in logcat looks like this...

    RadioStation {Name='Audioasyl', Url='http://stream.audioasyl.net:8000/audioasyl', Station='http://audioasyl.net', Genres='various, techno, house, dance, dubstep, minimal, funk, spokenword, hip-hop', Rating='4', Description='Audiasyl streams live and archived sets from and around Zürich. Check out the archived sets on the website.', IconUrl='https://static.radio.net/images/broadcasts/be/6a/9956/c175.png', City='Zürich', Country='CH', Language='English', AudioFormat='MP3', Bitrate='320', ChunkSize='32', BufferSize='48', ExcludedCodec='None', UpdateDataAtPlay='True', Channels='2', SampleRate='44100', TotalDataSize='0', TotalDataRequests='0', TotalPlayTime='0'}
    12-27 06:43:26.794 23694 30786 E Unity : Could not read url after 0:00!
    12-27 06:43:26.794 23694 30786 E Unity : System.NullReferenceException: Object reference not set to an instance of an object
    12-27 06:43:26.794 23694 30786 E Unity : at System.Net.WebRequestPrefixElement..ctor (System.String P, System.Type creatorType) [0x00018] in <6d066b05df624e3299ce5c89aeae679f>:0
    12-27 06:43:26.794 23694 30786 E Unity : at System.Net.WebRequest.PopulatePrefixList () [0x00040] in <6d066b05df624e3299ce5c89aeae679f>:0

    I made no changes at all to any of the demo scenes. I added them to the build for android and made sure Internet is required. I've had no problem with any other internet related services in my android apps.

    Not sure where to go from here. It looks like the icon pic comes through ok.

    The demo app build you provided before I purchased worked fine. What could I be doing wrong as to why the same demo won't work when built on my end. And it does play the stations fine in the editor in play mode.
     
  32. Stefan-Laubenberger

    Stefan-Laubenberger

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

    I think you should add the permission android:usesCleartextTraffic="true" to your AndroidManifest.xml.
    If that's not an option, please send us your invoice via email and we will give you access to an updated version which will allow to exclude non-HTTPS streams:
    upload_2021-12-27_14-30-28.png
     
  33. WizardGameDev

    WizardGameDev

    Joined:
    Jul 25, 2012
    Posts:
    62
    Greetings!

    Many thanks for the quick reply. I think my problem was I had the build set to mono vs il2pp. Or at least it seemed when I flipped that and rebuilt it played some of the stations. I think perhaps now the struggle is https vs http.

    Thanks for the help.
     
    Stefan-Laubenberger likes this.
  34. WizardGameDev

    WizardGameDev

    Joined:
    Jul 25, 2012
    Posts:
    62
    Greetings,

    So one thing I'm wanting to do in my game is have the radio get 'unlocked' fairly early in the game with perhaps a half dozen stations. Then as they progress through the game I'm wanting to unlock more stations.

    I'm sure I could brute force a variety of ways... I was just curious if anyone here could recommend an approach.

    My first instinct is to keep it simple programmatically and just break the full song list into perhaps 15 different lists with each one with more stations and then just swap the list out and have radiopro reload the new list.

    It also looked like it might be possible to use multiple providers and then take an additive approach where each list just adds more songs. This I like because it would be possible to introduce new stations out of order.

    I'm sure by the time this read I'll probably have some sort of solution... was just hoping maybe somebody could recommend an approach for this.
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Why not simply select the items from the list, e.g. level 1 => index 0 - 14, level 2 => index 0 - 29 and so on?
    Or you could use the "Limit" in the Filter-section and increment it every level:
    upload_2021-12-29_2-58-30.png
     
  36. WizardGameDev

    WizardGameDev

    Joined:
    Jul 25, 2012
    Posts:
    62
    Perfect! That is exactly the solution I was looking for!
     
    Stefan-Laubenberger likes this.
  37. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    176
    Very nice update - just one note, great, that you have pointed it out in README:
    "If you plan on including stations in a game that you release on a commercial basis,
    we strongly recommend that you contact the stations you want to use yourself."
    How on earth, one could contact 2000 radio stations to ask for permission?
     
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    You don't have to contact all stations, just make it possible that your users can see the details about the station, like a link to the website of the radio.
     
  39. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    176
    Thanks, for the answer. I have thought, that it should be the easier way to do that.
     
  40. jmdeb

    jmdeb

    Joined:
    Jul 28, 2017
    Posts:
    23
    I just started a project that has Radio Pro and DJ Pro. I've been looking around, but I can't remember how I can assign one and the other to different AudioSources so that they end up on different tracks in the mixer...could you please remind me how to assign Radio and DJ to specific tracks? (Both are inside the same gameobject)
     
    Last edited: Apr 14, 2022
  41. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Sorry, but I'm not exactly sure what you mean. DJ has the "Turntable" and Radio the "RadioPlayer" prefabs, which both have an AudioSource. So I would assume, you could add both objects to the mixer, or isn't it working?


    Happy easter!
    Stefan
     
  42. jmdeb

    jmdeb

    Joined:
    Jul 28, 2017
    Posts:
    23
    No, everything is fine...it's just that I don't use the Prefab but directly the scripts in an object 'AudioManager' which contains the 2 scripts 'RadioPlayer' and 'Turnable', as well as AudioSources...and I expected in your scripts to find a property to map the AudioSource of my choice...thanks for your help though!
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Turnable and RadioPlayer need their own GameObject and AudioSource, otherwise they can't work.
    I hope this helps you further.
     
  44. adrian-taylor09

    adrian-taylor09

    Joined:
    Dec 22, 2016
    Posts:
    53
    Is there any way to stream from a url that also contains video?
    For example, if there was a DJ who is streaming their set via OBS, can we stream the audio into unity?
     
  45. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Unfortunately, only MP3 and OGG audio streams are supported.


    Cheers
    Stefan
     
  46. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,851
    I'm struggling with the dreaded "No more data to read after 0:00!" error. The stream I am attempting to play (https://ice1.somafm.com/u80s-128-mp3) appears to be an MP3 stream, which matches my Stream Settings (Format=MP3, Bitrate=128, Chunk Size=32, Buffer Size=48). It plays fine in my web browser. Why won't it play in Unity?

    (I just downloaded Radio Pro today, so apologies if I'm missing something simple.)
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Hi Joe

    You have to use the one that works: https://ice1.somafm.com/u80s-256-mp3 ;)
    No seriously, our decoder is sometimes picky and it can't play non-standard MP3/OGG streams or with unstable connections (at least until the buffer is full). You could try to get better results by increasing the "Buffer Size" to 64 or 80 and/or lower the "Chunk Size" to 16 or even 8.
    The next update of Radio will hopefully minimize this issue.


    Cheers
    Stefan
     
  48. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,851
    OK, thank you.

    One more question. I'm using RadioPlayer directly with my own stream management. When the user hits "next station" I set the station URL and restart the player. I would then like to display the station title as soon as possible, ideally while buffering audio data, so the user can see right away what kind of music is coming. But in the OnBufferingStart callback, the station info is all that of the old station, not the new one we are currently loading.

    Is there any way I can find out what station we're now buffering before RecordChange happens?
     
  49. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,960
    Unfortunately, Radio has to read some data before it can tell you the name of the station.
    The next update will also improve this behaviour by skipping the pre-buffering (=faster response time) - you can send us your invoice via email to get the latest beta version.
    Meanwhile, you could set the name of the station by yourself (if you already know it).
     
    JoeStrout likes this.
  50. Dragantium

    Dragantium

    Joined:
    Feb 14, 2015
    Posts:
    34
    Greetings, I have problems running my app in the background on android. when the screen is locked the transmission lasts 30 seconds and starts to fail until it stops. I installed the Run in Bck Android package, I did tests changing the bitrate, chunk and buffer (I took it to 96) I commented the pause lines in Unity Player Activity and CTI Player activity, I put the scene elements in the Background Manager. I still have the problem. Using Unity 2020.3. and Samsung Galaxy S8. I really need help with this because I can't develop a radio player that doesn't run in sleep state. From already thank you very much for your time.