How to input desktop audio so i can retrieve spectrum data from it WASAPI loopback capture

I want to input the left and right channels of desktop audio so i can retrieve seperate spectrum data of the lefft and right

I recommend you take a look at the record_enumeration example, which can be found in the FMOD Engine download Core API example. That will show you how to record from a WASAPI loopback device and into a Sound object. Getting the spectrum data is then a matter of attaching an FFT DSP to the Sound’s Channel. We have a Spectrum Analysis example of how to achieve this in Unity.

I downloaded and imported the .unitypackage. i am struggling to find the examples you mentioned.

thank you for your previous response

No problem here are the steps in more detail:

  1. Go to the FMOD Download page
  2. Click on the tab labelled “FMOD Engine”
  3. Download the FMOD Engine for Windows
  4. Run the executable to install the FMOD Engine
  5. Navigate to “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows”, this is the root directory of the FMOD Engine
  6. Navigate down to “\api\core\examples\vs2019” and open examples.sln inside Visual studio 2019
  7. Once that opens, right click on the record_enumeration project in the Solution Explorer and select Set as Startup Project
  8. F5 to run

The code in the record_enumeration example will show you how to capture and playback from a loopback device. It is written in C++, which if you are familiar with C# should be understandable- just ignore any * or & and imagine that :: and -> are . operators, e.g

//C++
struct RECORD_STATE
{
    FMOD::Sound *sound;
    FMOD::Channel *channel;
};

//C#
struct RECORD_STATE
{
    FMOD.Sound sound;
    FMOD.Channel channel;
};

//C++
result = system->createSound(0, FMOD_LOOP_NORMAL | FMOD_OPENUSER, &exinfo, &record[cursor].sound);

//C#
result = system.createSound(0, FMOD_LOOP_NORMAL | FMOD_OPENUSER, exinfo, record[cursor].sound);

Thank you so much, ill try it latere today