Hello, I’m trying to use FMOD 2.03 with Unity 6, but There’s no sound out from Editor.
Please note that I only use LowLevelAPI as I need to load files from external assets
(cuz i’m making a rhythm game)
Here’s code and FMOD settings on my project
// class variables
private FMOD.System fmod;
private FMOD.ChannelGroup channelGroup;
private List<FMOD.Channel> channels;
private FMOD.Channel bgmChannel;
private FMOD.Channel previewChannel;
private FMOD.Channel hitChannel;
private Dictionary<string, FMOD.Sound> soundLib;
private static SoundControllerFMOD instance;
public static SoundControllerFMOD Instance
{
get
{
if (instance == null)
{
instance = new SoundControllerFMOD();
}
return instance;
}
}
// Global singleton FMOD init here
public SoundControllerFMOD()
{
FMODUnity.RuntimeManager.StudioSystem.getCoreSystem(out fmod);
fmod.setOutput(FMOD.OUTPUTTYPE.AUTODETECT);
fmod.init(512, FMOD.INITFLAGS.NORMAL, System.IntPtr.Zero);
int device;
Guid guid;
int systemrate;
SPEAKERMODE mode;
int modechn;
string name;
fmod.getDriver(out device);
fmod.getDriverInfo(
device,
out name,
256,
out guid,
out systemrate,
out mode,
out modechn
);
Debug.Log("DEVICE NAME: "+name);
channels = new List<FMOD.Channel>();
channelGroup = new FMOD.ChannelGroup();
soundLib = new Dictionary<string, FMOD.Sound>();
}
// Sound play here
public void PlayBGMSound(string name)
{
Debug.Log("FILE" + name);
FMOD.RESULT result = fmod.playSound(
soundLib[name],
channelGroup,
false,
out bgmChannel
);
Debug.Log("BGM RESULT: "+result.ToString());
bgmChannel.setVolume(Const.VolumeMaster * Const.VolumeSystemBGM);
float vol;
bgmChannel.getVolume(out vol);
Debug.Log("BGM VOL: "+vol.ToString());
FMOD.RESULT rst = bgmChannel.setMode(FMOD.MODE.LOOP_NORMAL);
}
I don’t care about project cuz I don’t use studio API. Just a simple empty project file is here
FMOD Settings
Unity Project Settings - Audio
Global Volume is max and Disable Unity Audio
checked.
playSound method gives me FMOD_OK
, and volume is not 0
Unity is not muted
Channels has sound assets (channel keep changes as I make createSound
methods) but actual volume is always -80 db
There’s no error, no warning, no other signs and no sound.
I tried in both Windows and Mac, and neither does not work.
Any help will be appreciated
Thanks