Answered
0
0

I tried to play music from the local folder, but there’s nothing but silence when I run the game. Here’s the code (C#):

using UnityEngine;
using System.Collections;
using FMOD;

public class music: MonoBehaviour {

FMOD.RESULT result;
FMOD.Sound sound1;
FMOD.System system;
FMOD.Channel channel;
FMOD.ChannelGroup channelGroup;

void Start () {
    FMOD.Factory.System_Create (out system);
    result = system.createChannelGroup (null, out channelGroup);
    channel.setChannelGroup (channelGroup);
    result = system.createSound ("C:/song.mp3", FMOD.MODE.DEFAULT, out sound1);
    result = system.playSound (sound1, channelGroup, false, out channel);
    }
}

This script is added as a component to a gameObject on stage.
Thanks in advance.

  • You must to post comments
Best Answer
0
0

Add an Update() method to your behaviour and call system.update.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.