Search Unity

Audio Best Way To Get/sample Audio Playing On The Host Device

Discussion in 'Audio & Video' started by aBs0lut3_z3r0, Apr 11, 2019.

  1. aBs0lut3_z3r0

    aBs0lut3_z3r0

    Joined:
    Apr 11, 2014
    Posts:
    6
    So, I've been tinkering for a while with a little music visualizer app.
    I've been working on it on windows obviously and I've been using the AudioStream package available in the asset store.

    I'm wondering though if anyone knows of any better way to get the audio data?
    AudioStream(via FMOD) works, but it's pretty laggy. Would love something with data closer to realtime.

    On the same vain, anyone have any ideas how (or if it's even remotely doable, which I somehow doubt) to do that on mobile? Mainly android, although iOS would be nice, but I tend to think that's even more unlikely than getting it worked out on android...

    Sample/FFT data is all I want, from whatever is playing...
    On mobile for example, say a youtube video playing background...

    Local files are no issue at all, but as we all know, there's not many people using local music. Everything is streaming. I'm sure I could probably get a player working for the popular services, but good lord that's a lot of work compared to just grabbing what something else is already playing.

    Thought, ideas, or am I just crazy?
     
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    * You might want to have a look at LASP: https://github.com/keijiro/Lasp
    - I don't use it in the asset because it's restricted to default device only (maybe can be patched), and runs only on standalones

    * you can do fft analysis in FMOD via a dsp effect - this is not in the asset currently, because I would lost interop with Unity AudioSources, but it can be done

    * FMOD can be initialized with ASIO drivers (it's not easy to support this in generic fashion, but if you search sources for ASIO you might find commented out initialization code :)
    - ASIO drivers configuration is ... specific

    * as for mobiles: no, you're not crazy :]