How to load an *.mp3 from my asset in unity using FMOD?

250 Views Asked by At

I have an application that you can put your own songs and I want it to load them with the FMOD system.

I'm trying this and unity closes me

FMOD.RESULT result;
FMOD.Sound sound1;
FMOD.System system;
FMOD.Channel channel;
FMOD.ChannelGroup channelGroup;
private void Start()
{
    LoadSong();
}
public async void LoadSong()
{

    FMOD.Factory.System_Create(out system);
    result = system.createChannelGroup(null, out channelGroup);
    channel.setChannelGroup(channelGroup);
    result = system.createSound("/Audio/BgMusic/BackgroundMusicLoop.mp3", FMOD.MODE.DEFAULT, out sound1);
    result = system.playSound(sound1, channelGroup, false, out channel);
}
0

There are 0 best solutions below