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

C# SOUND_FORMAT类代码示例

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

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



SOUND_FORMAT类属于命名空间,在下文中一共展示了SOUND_FORMAT类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FMOD_System_GetSoftwareFormat

 private static extern RESULT FMOD_System_GetSoftwareFormat(IntPtr system, ref int samplerate, ref SOUND_FORMAT format, ref int numoutputchannels, ref int maxinputchannels, ref DSP_RESAMPLER resamplemethod, ref int bits);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs


示例2: FMOD_System_SetSoftwareFormat

 private static extern RESULT FMOD_System_SetSoftwareFormat(IntPtr system, int samplerate, SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, DSP_RESAMPLER resamplemethod);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs


示例3: getSoftwareFormat

 public RESULT getSoftwareFormat(ref int samplerate, ref SOUND_FORMAT format, ref int numoutputchannels, ref int maxinputchannels, ref DSP_RESAMPLER resamplemethod, ref int bits)
 {
     return FMOD_System_GetSoftwareFormat(systemraw, ref samplerate, ref format, ref numoutputchannels, ref maxinputchannels, ref resamplemethod, ref bits);
 }
开发者ID:huming2207,项目名称:ghgame,代码行数:4,代码来源:fmod.cs


示例4: setSoftwareFormat

 public RESULT setSoftwareFormat(int samplerate, SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, DSP_RESAMPLER resamplemethod)
 {
     return FMOD_System_SetSoftwareFormat(systemraw, samplerate, format, numoutputchannels, maxinputchannels, resamplemethod);
 }
开发者ID:huming2207,项目名称:ghgame,代码行数:4,代码来源:fmod.cs


示例5: FMOD_Sound_GetFormat

 private static extern RESULT FMOD_Sound_GetFormat(IntPtr sound, ref SOUND_TYPE type, ref SOUND_FORMAT format, ref int channels, ref int bits);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs


示例6: getFormat

 public RESULT getFormat(ref SOUND_TYPE type, ref SOUND_FORMAT format, ref int channels, ref int bits)
 {
     return FMOD_Sound_GetFormat(soundraw, ref type, ref format, ref channels, ref bits);
 }
开发者ID:huming2207,项目名称:ghgame,代码行数:4,代码来源:fmod.cs


示例7: FMOD_Sound_GetFormat

 public RESULT getFormat               (out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits)
 {
     return FMOD_Sound_GetFormat(rawPtr, out type, out format, out channels, out bits);
 }
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:4,代码来源:fmod.cs


示例8:

 private static extern RESULT FMOD5_Sound_GetFormat               (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits);
开发者ID:ajm1996,项目名称:SpaceSalvage,代码行数:1,代码来源:fmod.cs


示例9: WriteHeader

 static uint WriteHeader(FileStream SubSoundStream, FMOD.Sound SubSound, string FSBFileStr)
 {
     uint Milliseconds = 0;
     uint RAWBytes = 0;
     uint PCMBytes = 0;
     uint PCMSamples = 0;
     uint Length = 0;
     SubSound.getLength(ref Milliseconds, TIMEUNIT.MS);					// Get the length of the current wave file
     SubSound.getLength(ref RAWBytes, TIMEUNIT.RAWBYTES);					// Get the length of the current wave file
     SubSound.getLength(ref PCMSamples, TIMEUNIT.PCM);					// Get the length of the current wave file
     SubSound.getLength(ref PCMBytes, TIMEUNIT.PCMBYTES);					// Get the length of the current wave file
     // Seek to the beginning of our newly created output file
     SubSoundStream.Seek(0, SeekOrigin.Begin);
     float Frequency = 0f;			// Set some default values that aren't very
     int DefPriority = 0;			// important because they'll get overwritten
     float DefPan = 0;
     float DefVolume = 0;
     FMOD.SOUND_TYPE FModSoundType = new SOUND_TYPE();
     FMOD.SOUND_FORMAT FModSoundFormat = new SOUND_FORMAT();
     int Channels = 0;
     int BitsPerSample = 0;
     // Get the default Frequency (important), and other stuff (not important)
     SubSound.getDefaults(ref Frequency, ref DefVolume, ref DefPan, ref DefPriority);
     // Get the actual sound format. We pretty much ignore this data since we know its going to be WAV, RIFF, PCM
     SubSound.getFormat(ref FModSoundType, ref FModSoundFormat, ref Channels, ref BitsPerSample);
     //Console.WriteLine("      MS={0}\tRAWBytes={1}\tPCMSamples={2}\tPCMBytes={3}", Milliseconds, RAWBytes, PCMSamples, PCMBytes);
     //Console.WriteLine("      Freq={0}\tChan={1}", Frequency, Channels);
     if (Switches.Contains("/doublefreq")) {
         if (Channels == 1) { Frequency = Frequency * 2; }
     }
     int BlockAlign = Channels * (BitsPerSample / 8);
     float DataRate = Channels * Frequency * (BitsPerSample / 8);
     PCMSamples = Convert.ToUInt32(Milliseconds * Frequency / 1000);
     // This is more of a sloppy hack. I don't know if I am just reading the file incorrectly, or using the wrong
     // version of the API, or the FSB files are incorrectly structured, but the metadata that comes from the file
     // seems to be incorrect. According to the WAV/RIFF specification and the FMOD API Documentation the
     // following line should be the correct computation. If you use just the following line you get a random
     // blip at the end of the sounds for the voice overs and the SFX don't play at all. A annoying
     // trial-and-error process revealed that the logic below works properly. I wish there was a better way to
     // identify which file we're parsing other than "SFX" in the name.
     // "Correct" Computation: Length = Convert.ToUInt32(PCMSamples * Channels * (BitsPerSample / 8));
     if (Path.GetFileName(FSBFileStr).Contains("VOBank")) {
         // If we're parsing the VOBank FSB
         if (Channels == 2) {					// Works for the Character Speech FSBs
             Length = Convert.ToUInt32(PCMSamples * Channels * (BitsPerSample / 8));
         } else {
             Length = PCMBytes * 2;
         }
     } else {
         // If we're parsing a SFX FSB
         if (Channels == 2) {					// Works for the SFX FSBs
             Length = PCMBytes;
         } else {
             //Length = Convert.ToUInt32(PCMSamples * Channels * (BitsPerSample / 8));
             //Console.WriteLine("      CustomLen={0}\tPCMBytes={1}\tDiff={2}", Convert.ToUInt32(PCMSamples * Channels * (BitsPerSample / 8)), PCMBytes, (Convert.ToUInt32(PCMSamples * Channels * (BitsPerSample / 8)) - PCMBytes) * 1.0 / PCMBytes * 1.0);
             if (Switches.Contains("/doublelen")) {
                 Length = PCMBytes * 2;
             } else {
                 Length = PCMBytes;
             }
         }
     }
     // Some debugging outputs:
     //Console.WriteLine("      MS={0}\tRAWBytes={1}\tPCMSamples={2}\tPCMBytes={3}", Milliseconds, RAWBytes, PCMSamples, PCMBytes);
     //Console.WriteLine("      Freq={0}\tChan={1}\tBits/Sam={2}\tDataRate={3}", Frequency, Channels, BitsPerSample, DataRate);
     // WAVE RIFF Format: http://www.topherlee.com/software/pcm-tut-wavformat.html
     // Write the actual specification to the header of the file.
     SubSoundStream.Write(BitConverter.GetBytes('R'), 0, 1);					// 0 - Letter R
     SubSoundStream.Write(BitConverter.GetBytes('I'), 0, 1);					// 1 - Letter I
     SubSoundStream.Write(BitConverter.GetBytes('F'), 0, 1);					// 2 - Letter F
     SubSoundStream.Write(BitConverter.GetBytes('F'), 0, 1);					// 3 - Letter F
     SubSoundStream.Write(BitConverter.GetBytes((long)0), 0, 4);		// 4,5,6,7 - Length of entire file minus 8
     SubSoundStream.Write(BitConverter.GetBytes('W'), 0, 1);					// 8 - Letter W
     SubSoundStream.Write(BitConverter.GetBytes('A'), 0, 1);					// 9 - Letter A
     SubSoundStream.Write(BitConverter.GetBytes('V'), 0, 1);					// 10 - Letter V
     SubSoundStream.Write(BitConverter.GetBytes('E'), 0, 1);					// 11 - Letter E
     SubSoundStream.Write(BitConverter.GetBytes('f'), 0, 1);					// 12 - Letter f
     SubSoundStream.Write(BitConverter.GetBytes('m'), 0, 1);					// 13 - Letter m
     SubSoundStream.Write(BitConverter.GetBytes('t'), 0, 1);					// 14 - Letter t
     SubSoundStream.Write(BitConverter.GetBytes(' '), 0, 1);					// 15 - Space
     SubSoundStream.Write(BitConverter.GetBytes((long)16), 0, 4);			// 16,17,18,19 - Size of following subchunk
     SubSoundStream.Write(BitConverter.GetBytes((int)1), 0, 2);				// 20,21 - Format code (PCM)
     SubSoundStream.Write(BitConverter.GetBytes((int)Channels), 0, 2);		// 22,23 - Number of channels
     SubSoundStream.Write(BitConverter.GetBytes((long)Frequency), 0, 4);			// 24,25,26,27 - Sampling Rate (Blocks Per Second)
     SubSoundStream.Write(BitConverter.GetBytes((int)DataRate), 0, 4);	// 28,29,30,31 - Data rate
     SubSoundStream.Write(BitConverter.GetBytes(BlockAlign), 0, 2);				// 32,33 - Data block size (bytes)
     SubSoundStream.Write(BitConverter.GetBytes(BitsPerSample), 0, 2);				// 34,35 - Bits per sample
     SubSoundStream.Write(BitConverter.GetBytes('d'), 0, 1);					// 36 - Letter d
     SubSoundStream.Write(BitConverter.GetBytes('a'), 0, 1);					// 37 - Letter a
     SubSoundStream.Write(BitConverter.GetBytes('t'), 0, 1);					// 38 - Letter t
     SubSoundStream.Write(BitConverter.GetBytes('a'), 0, 1);					// 39 - Letter a
     SubSoundStream.Write(BitConverter.GetBytes((long)Length), 0, 4);		// 40,41,42,43 - Size of Data Section
     return Length;
 }
开发者ID:SpectralCoding,项目名称:lol-fsb-extract,代码行数:94,代码来源:Program.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SOUND_TYPE类代码示例发布时间:2022-05-24
下一篇:
C# SOUNDGROUP_BEHAVIOR类代码示例发布时间: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