本文整理汇总了C#中BufferDescription.set_BufferBytes方法的典型用法代码示例。如果您正苦于以下问题:C# BufferDescription.set_BufferBytes方法的具体用法?C# BufferDescription.set_BufferBytes怎么用?C# BufferDescription.set_BufferBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BufferDescription
的用法示例。
在下文中一共展示了BufferDescription.set_BufferBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadFromDisk
public SecondaryBuffer ReadFromDisk(int SoundID)
{
if (m_Device == null)
{
return null;
}
if (SoundID < 0)
{
return null;
}
m_Index.BaseStream.Seek((long) (SoundID * 12), SeekOrigin.Begin);
int num = m_Index.ReadInt32();
int num2 = m_Index.ReadInt32();
int num3 = m_Index.ReadInt32();
if ((num < 0) || (num2 <= 0))
{
if (!this.Translate(ref SoundID))
{
return null;
}
m_Index.BaseStream.Seek((long) (SoundID * 12), SeekOrigin.Begin);
num = m_Index.ReadInt32();
num2 = m_Index.ReadInt32();
num3 = m_Index.ReadInt32();
}
if ((num < 0) || (num2 <= 0))
{
return null;
}
num2 -= 40;
m_Stream.Seek((long) (num + 40), SeekOrigin.Begin);
BufferDescription description = new BufferDescription(m_Format);
description.set_BufferBytes(num2);
description.set_ControlPan(true);
description.set_ControlVolume(true);
SecondaryBuffer buffer = new SecondaryBuffer(description, m_Device);
buffer.Write(0, m_Stream, num2, 2);
return buffer;
}