1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FMOD;
using FMODNet;
namespace ConsoleApplication1
{
public class Channel
{
class gestionSons
{
private FMOD.System system = null;
private FMOD.Sound sound = null;
private FMOD.Channel channel = null;
uint version = 0;
private static CHANNEL_CALLBACK channelCallback;
FMOD.RESULT result;
private void ERRCHECK(FMOD.RESULT result, int v)
{
Console.WriteLine(" Passage ----> " + result + " " + v);
if (result != FMOD.RESULT.OK)
{
Console.WriteLine(" PB ----> " + result + " " + v);
Environment.Exit(-1);
}
}
public void toutInitialiser()
{
result = FMOD.Factory.System_Create(ref system);
ERRCHECK(result, 0);
result = system.getVersion(ref version);
ERRCHECK(result, 1);
result = system.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
ERRCHECK(result, 2);
result = system.createSound("C:/Documents and Settings/IEC/Bureau/ConsoleApplication1/ConsoleApplication1/jaguar.wav", FMOD.MODE._3D, ref sound);
ERRCHECK(result, 3);
result = system.playSound(FMOD.CHANNELINDEX.FREE, sound, true, ref channel);
ERRCHECK(result, 4);
System.Console.ReadLine();
}
}
static void Main(string[] args)
{
gestionSons ngt = new gestionSons();
ngt.toutInitialiser();
}
}
} |
Partager