• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FMOD.CREATESOUNDEXINFO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FMOD.CREATESOUNDEXINFO的典型用法代码示例。如果您正苦于以下问题:C# CREATESOUNDEXINFO类的具体用法?C# CREATESOUNDEXINFO怎么用?C# CREATESOUNDEXINFO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CREATESOUNDEXINFO类属于FMOD命名空间,在下文中一共展示了CREATESOUNDEXINFO类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
            }
        }
开发者ID:narlon,项目名称:TOMClassic,代码行数:33,代码来源:SoundManager.cs


示例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;
        }
开发者ID:tj-miller,项目名称:TextAdventure,代码行数:21,代码来源:Sound.cs


示例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;
        }
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:15,代码来源:fmod.cs


示例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;
        }
开发者ID:kendobi,项目名称:Entropy_V5,代码行数:12,代码来源:fmod.cs


示例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;
        }
开发者ID:kendobi,项目名称:Entropy_V5,代码行数:43,代码来源:fmod.cs


示例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;
        }
开发者ID:kendobi,项目名称:Entropy_V5,代码行数:44,代码来源:fmod.cs


示例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;
        }
开发者ID:huming2207,项目名称:ghgame,代码行数:32,代码来源:fmod.cs


示例8: MediaObject

 public MediaObject()
 {
     // Zero out the extra info structure.
     extraInfo = new FMOD.CREATESOUNDEXINFO();
     extraInfo.cbsize = Marshal.SizeOf(extraInfo);
 }
开发者ID:Nuriat,项目名称:radegast,代码行数:6,代码来源:MediaObject.cs


示例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;
        }
开发者ID:whztt07,项目名称:GameEngine,代码行数:43,代码来源:fmod.cs


示例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;
        }
开发者ID:NuXareon,项目名称:Tower_Defense,代码行数:21,代码来源:fmod.cs


示例11: CreateSoundExInfo

 public CreateSoundExInfo(ref CREATESOUNDEXINFO exinfo)
 {
     FMODInfo = exinfo;
 }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:4,代码来源:CreateSoundExInfo.cs


示例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;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:10,代码来源:System.cs


示例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);
        }
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:7,代码来源:fmod.cs


示例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;
        }
开发者ID:nathan-alden,项目名称:old-text-adventure,代码行数:34,代码来源:fmod.cs


示例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);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs


示例16: CreateSound

        private Sound CreateSound()
        {
            var createSoundInfo = new CREATESOUNDEXINFO();

            createSoundInfo.cbsize = Marshal.SizeOf(createSoundInfo);
            createSoundInfo.defaultfrequency = this.sampleRate;
            createSoundInfo.numchannels = this.channelCount;
            createSoundInfo.format = SOUND_FORMAT.PCM16;
            createSoundInfo.length = (uint)(createSoundInfo.defaultfrequency * createSoundInfo.numchannels * sizeof(short) * 0.5f);

            Sound sound;

            this.fmodSystem.createSound("sound", MODE.LOOP_NORMAL | MODE.OPENUSER | MODE._2D, ref createSoundInfo, out sound);

            return sound;
        }
开发者ID:rychuelektryk,项目名称:UprightBassTeacher,代码行数:16,代码来源:InputMonitor.cs



注:本文中的FMOD.CREATESOUNDEXINFO类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FMOD.Channel类代码示例发布时间:2022-05-24
下一篇:
C# FMOD.ADVANCEDSETTINGS类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap