本文整理汇总了C#中FMOD.CREATESOUNDEXINFO类的典型用法代码示例。如果您正苦于以下问题:C# CREATESOUNDEXINFO类的具体用法?C# CREATESOUNDEXINFO怎么用?C# CREATESOUNDEXINFO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CREATESOUNDEXINFO类属于FMOD命名空间,在下文中一共展示了CREATESOUNDEXINFO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Play
private static void Play(string path, bool isBGM)
{
var file = NLVFS.NLVFS.LoadFile(path);
if (file == null)
{
NLog.Warn("fmod Play file not Found " + path);
return;
}
var info = new CREATESOUNDEXINFO();
info.length = (uint)file.Length;
Sound s;
var result = _fmod.createSound(file, MODE.OPENMEMORY, ref info, out s);
if (result != RESULT.OK)
{
NLog.Error("fmod createSound " + result);
}
Channel channel;
result = _fmod.playSound(s, null, false, out channel);
_fmod.update();
int index;
channel.getIndex(out index);
if (result != RESULT.OK)
{
NLog.Error("fmod playSound " + result);
}
if (isBGM)
{
_channelBGM = channel;
}
}
示例2: Sound
public Sound(SoundSystem soundSystem, byte[] data)
{
soundSystem.ThrowIfNull("soundSystem");
data.ThrowIfNull("data");
var createsoundexinfo = new CREATESOUNDEXINFO
{
cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO)),
length = (uint)data.Length
};
// ReSharper disable BitwiseOperatorOnEnumWihtoutFlags
RESULT result = soundSystem.System.createSound(data, MODE.HARDWARE | MODE.OPENMEMORY, ref createsoundexinfo, ref _sound);
// ReSharper restore BitwiseOperatorOnEnumWihtoutFlags
if (result != RESULT.OK)
{
throw new Exception(GetExceptionMessage("Failed to create FMOD sound.", result));
}
_soundSystem = soundSystem;
}
示例3: Sound
public RESULT createStream (string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound)
{
sound = null;
byte[] stringData;
stringData = Encoding.UTF8.GetBytes(name + Char.MinValue);
exinfo.cbsize = Marshal.SizeOf(exinfo);
IntPtr soundraw;
RESULT result = FMOD_System_CreateStream(rawPtr, stringData, mode, ref exinfo, out soundraw);
sound = new Sound(soundraw);
return result;
}
示例4: Sound
public RESULT createStream (byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound)
{
sound = null;
CREATESOUNDEXINFO_INTERNAL exinfoInternal = CREATESOUNDEXINFO_INTERNAL.CreateFromExternal(ref exinfo);
IntPtr soundraw;
RESULT result = FMOD5_System_CreateStream(rawPtr, data, mode, ref exinfoInternal, out soundraw);
sound = new Sound(soundraw);
return result;
}
示例5: CreateFromInternal
public static CREATESOUNDEXINFO CreateFromInternal(ref CREATESOUNDEXINFO_INTERNAL exinfoInt)
{
CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO();
exinfo.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO_INTERNAL));
exinfo.fileoffset = exinfoInt.fileoffset;
exinfo.numchannels = exinfoInt.numchannels;
exinfo.defaultfrequency = exinfoInt.defaultfrequency;
exinfo.format = exinfoInt.format;
exinfo.decodebuffersize = exinfoInt.decodebuffersize;
exinfo.initialsubsound = exinfoInt.initialsubsound;
exinfo.numsubsounds = exinfoInt.numsubsounds;
exinfo.inclusionlist = exinfoInt.inclusionlist;
exinfo.inclusionlistnum = exinfoInt.inclusionlistnum;
exinfo.pcmreadcallback = exinfoInt.pcmreadcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.pcmreadcallback, typeof(SOUND_PCMREADCALLBACK)) as SOUND_PCMREADCALLBACK : null;
exinfo.pcmsetposcallback = exinfoInt.pcmsetposcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.pcmsetposcallback, typeof(SOUND_PCMSETPOSCALLBACK)) as SOUND_PCMSETPOSCALLBACK : null;
exinfo.nonblockcallback = exinfoInt.nonblockcallback != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.nonblockcallback, typeof(SOUND_NONBLOCKCALLBACK)) as SOUND_NONBLOCKCALLBACK : null;
exinfo.dlsname = exinfoInt.dlsname;
exinfo.encryptionkey = exinfoInt.encryptionkey;
exinfo.maxpolyphony = exinfoInt.maxpolyphony;
exinfo.userdata = exinfoInt.userdata;
exinfo.suggestedsoundtype = exinfoInt.suggestedsoundtype;
exinfo.fileuseropen = exinfoInt.fileuseropen != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuseropen, typeof(FILE_OPENCALLBACK)) as FILE_OPENCALLBACK : null;
exinfo.fileuserclose = exinfoInt.fileuserclose != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserclose, typeof(FILE_CLOSECALLBACK)) as FILE_CLOSECALLBACK : null;
exinfo.fileuserread = exinfoInt.fileuserread != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserread, typeof(FILE_READCALLBACK)) as FILE_READCALLBACK : null;
exinfo.fileuserseek = exinfoInt.fileuserseek != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserseek, typeof(FILE_SEEKCALLBACK)) as FILE_SEEKCALLBACK : null;
exinfo.fileuserasyncread = exinfoInt.fileuserasyncread != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserasyncread, typeof(FILE_ASYNCREADCALLBACK)) as FILE_ASYNCREADCALLBACK : null;
exinfo.fileuserasynccancel = exinfoInt.fileuserasynccancel != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer(exinfoInt.fileuserasynccancel, typeof(FILE_ASYNCCANCELCALLBACK)) as FILE_ASYNCCANCELCALLBACK : null;
exinfo.fileuserdata = exinfoInt.fileuserdata;
exinfo.filebuffersize = exinfoInt.filebuffersize;
exinfo.channelorder = exinfoInt.channelorder;
exinfo.channelmask = exinfoInt.channelmask;
exinfo.initialsoundgroup = exinfoInt.initialsoundgroup;
exinfo.initialseekposition = exinfoInt.initialseekposition;
exinfo.initialseekpostype = exinfoInt.initialseekpostype;
exinfo.ignoresetfilesystem = exinfoInt.ignoresetfilesystem;
exinfo.audioqueuepolicy = exinfoInt.audioqueuepolicy;
exinfo.minmidigranularity = exinfoInt.minmidigranularity;
exinfo.nonblockthreadid = exinfoInt.nonblockthreadid;
exinfo.fsbguid = exinfoInt.fsbguid;
return exinfo;
}
示例6: CreateFromExternal
public IntPtr fsbguid; /* [r/w] Optional. Specify 0 to ignore. Allows you to provide the GUID lookup for cached FSB header info. Once loaded the GUID will be written back to the pointer. This is to avoid seeking and reading the FSB header. */
public static CREATESOUNDEXINFO_INTERNAL CreateFromExternal(ref CREATESOUNDEXINFO exinfoExt)
{
CREATESOUNDEXINFO_INTERNAL exinfoInt = new CREATESOUNDEXINFO_INTERNAL();
exinfoInt.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO_INTERNAL));
exinfoInt.fileoffset = exinfoExt.fileoffset;
exinfoInt.numchannels = exinfoExt.numchannels;
exinfoInt.defaultfrequency = exinfoExt.defaultfrequency;
exinfoInt.format = exinfoExt.format;
exinfoInt.decodebuffersize = exinfoExt.decodebuffersize;
exinfoInt.initialsubsound = exinfoExt.initialsubsound;
exinfoInt.numsubsounds = exinfoExt.numsubsounds;
exinfoInt.inclusionlist = exinfoExt.inclusionlist;
exinfoInt.inclusionlistnum = exinfoExt.inclusionlistnum;
exinfoInt.pcmreadcallback = exinfoExt.pcmreadcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.pcmreadcallback) : IntPtr.Zero;
exinfoInt.pcmsetposcallback = exinfoExt.pcmsetposcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.pcmsetposcallback) : IntPtr.Zero;
exinfoInt.nonblockcallback = exinfoExt.nonblockcallback != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.nonblockcallback) : IntPtr.Zero;
exinfoInt.dlsname = exinfoExt.dlsname;
exinfoInt.encryptionkey = exinfoExt.encryptionkey;
exinfoInt.maxpolyphony = exinfoExt.maxpolyphony;
exinfoInt.userdata = exinfoExt.userdata;
exinfoInt.suggestedsoundtype = exinfoExt.suggestedsoundtype;
exinfoInt.fileuseropen = exinfoExt.fileuseropen != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuseropen) : IntPtr.Zero;
exinfoInt.fileuserclose = exinfoExt.fileuserclose != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserclose) : IntPtr.Zero;
exinfoInt.fileuserread = exinfoExt.fileuserread != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserread) : IntPtr.Zero;
exinfoInt.fileuserseek = exinfoExt.fileuserseek != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserseek) : IntPtr.Zero;
exinfoInt.fileuserasyncread = exinfoExt.fileuserasyncread != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserasyncread) : IntPtr.Zero;
exinfoInt.fileuserasynccancel = exinfoExt.fileuserasynccancel != null ? Marshal.GetFunctionPointerForDelegate(exinfoExt.fileuserasynccancel) : IntPtr.Zero;
exinfoInt.fileuserdata = exinfoExt.fileuserdata;
exinfoInt.filebuffersize = exinfoExt.filebuffersize;
exinfoInt.channelorder = exinfoExt.channelorder;
exinfoInt.channelmask = exinfoExt.channelmask;
exinfoInt.initialsoundgroup = exinfoExt.initialsoundgroup;
exinfoInt.initialseekposition = exinfoExt.initialseekposition;
exinfoInt.initialseekpostype = exinfoExt.initialseekpostype;
exinfoInt.ignoresetfilesystem = exinfoExt.ignoresetfilesystem;
exinfoInt.audioqueuepolicy = exinfoExt.audioqueuepolicy;
exinfoInt.minmidigranularity = exinfoExt.minmidigranularity;
exinfoInt.nonblockthreadid = exinfoExt.nonblockthreadid;
exinfoInt.fsbguid = exinfoExt.fsbguid;
return exinfoInt;
}
示例7: createStream
public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, ref Sound sound)
{
RESULT result = RESULT.OK;
IntPtr soundraw = new IntPtr();
Sound soundnew = null;
try
{
result = FMOD_System_CreateStream(systemraw, data, mode, ref exinfo, ref soundraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (sound == null)
{
soundnew = new Sound();
soundnew.setRaw(soundraw);
sound = soundnew;
}
else
{
sound.setRaw(soundraw);
}
return result;
}
示例8: MediaObject
public MediaObject()
{
// Zero out the extra info structure.
extraInfo = new FMOD.CREATESOUNDEXINFO();
extraInfo.cbsize = Marshal.SizeOf(extraInfo);
}
示例9: IntPtr
public RESULT createStream (string name, MODE mode, ref CREATESOUNDEXINFO exinfo, ref Sound sound)
{
RESULT result = RESULT.OK;
IntPtr soundraw = new IntPtr();
Sound soundnew = null;
byte[] stringData;
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
stringData = Encoding.Unicode.GetBytes(name + Char.MinValue);
mode = mode | FMOD.MODE.UNICODE;
}
else
{
stringData = Encoding.UTF8.GetBytes(name + Char.MinValue);
}
try
{
result = FMOD_System_CreateStream(systemraw, stringData, mode, ref exinfo, ref soundraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (sound == null)
{
soundnew = new Sound();
soundnew.setRaw(soundraw);
sound = soundnew;
}
else
{
sound.setRaw(soundraw);
}
return result;
}
示例10: Sound
public RESULT createStream (string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound)
{
sound = null;
byte[] stringData;
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
stringData = Encoding.Unicode.GetBytes(name + Char.MinValue);
mode = mode | FMOD.MODE.UNICODE;
}
else
{
stringData = Encoding.UTF8.GetBytes(name + Char.MinValue);
}
IntPtr soundraw;
RESULT result = FMOD_System_CreateStream(rawPtr, stringData, mode, ref exinfo, out soundraw);
sound = new Sound(soundraw);
return result;
}
示例11: CreateSoundExInfo
public CreateSoundExInfo(ref CREATESOUNDEXINFO exinfo)
{
FMODInfo = exinfo;
}
示例12: createSound
public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound)
{
sound = null;
byte[] bytes = Encoding.UTF8.GetBytes(name + '\0');
exinfo.cbsize = Marshal.SizeOf(exinfo);
IntPtr raw;
RESULT result = System.FMOD5_System_CreateSound(this.rawPtr, bytes, mode, ref exinfo, out raw);
sound = new Sound(raw);
return result;
}
示例13: CREATESOUNDEXINFO
public RESULT createStream (string name, MODE mode, out Sound sound)
{
CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO();
exinfo.cbsize = Marshal.SizeOf(exinfo);
return createStream(name, mode, ref exinfo, out sound);
}
示例14: createStream
public RESULT createStream(string name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, ref Sound sound)
{
var result = RESULT.OK;
var soundraw = new IntPtr();
Sound soundnew = null;
mode = mode | MODE.UNICODE;
try
{
result = FMOD_System_CreateStream(systemraw, name_or_data, mode, ref exinfo, ref soundraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (sound == null)
{
soundnew = new Sound();
soundnew.setRaw(soundraw);
sound = soundnew;
}
else
{
sound.setRaw(soundraw);
}
return result;
}
示例15: FMOD_System_CreateStream
private static extern RESULT FMOD_System_CreateStream(IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, ref IntPtr sound);