当前位置: 首页>>代码示例>>C#>>正文


C# AudioManager.ToDisposeAudioAsset方法代码示例

本文整理汇总了C#中AudioManager.ToDisposeAudioAsset方法的典型用法代码示例。如果您正苦于以下问题:C# AudioManager.ToDisposeAudioAsset方法的具体用法?C# AudioManager.ToDisposeAudioAsset怎么用?C# AudioManager.ToDisposeAudioAsset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AudioManager的用法示例。


在下文中一共展示了AudioManager.ToDisposeAudioAsset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FromStream

 /// <summary>
 /// Initializes a new wave bank from the provided stream.
 /// </summary>
 /// <param name="audioManager">The associated audio manager.</param>
 /// <param name="stream">The stream containing wave bank data.</param>
 /// <returns>The wave bank initialized from provided stream.</returns>
 public static WaveBank FromStream(AudioManager audioManager, Stream stream)
 {
     return audioManager.ToDisposeAudioAsset(new WaveBank(audioManager, stream));
 }
开发者ID:RecursiveCall,项目名称:SharpDX,代码行数:10,代码来源:WaveBank.cs

示例2: FromStream

        /// <summary>
        /// Creates a new instance of the <see cref="SoundEffect"/> class from the spefified data stream.
        /// </summary>
        /// <param name="audioManager">The audio manager associated to the created instance.</param>
        /// <param name="stream">The stream containing the data from which to create the effect.</param>
        /// <param name="name">The name of the effect (optional).</param>
        /// <returns>The created effect.</returns>
        public static SoundEffect FromStream(AudioManager audioManager, Stream stream, string name = null)
        {
            if (audioManager == null)
                throw new ArgumentNullException("audioManager");

            if (stream == null)
                throw new ArgumentNullException("stream");

            var sound = new SoundStream(stream);
            var format = sound.Format;
            var decodedPacketsInfo = sound.DecodedPacketsInfo;
            var buffer = sound.ToDataStream();

            sound.Dispose();

            return audioManager.ToDisposeAudioAsset(new SoundEffect(audioManager, name, format, buffer, decodedPacketsInfo));
        }
开发者ID:EvanMachusak,项目名称:SharpDX,代码行数:24,代码来源:SoundEffect.cs


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