本文整理汇总了C++中AUD_Reference::write方法的典型用法代码示例。如果您正苦于以下问题:C++ AUD_Reference::write方法的具体用法?C++ AUD_Reference::write怎么用?C++ AUD_Reference::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AUD_Reference
的用法示例。
在下文中一共展示了AUD_Reference::write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeReader
void AUD_FileWriter::writeReader(AUD_Reference<AUD_IReader> reader, AUD_Reference<AUD_IWriter> writer, unsigned int length, unsigned int buffersize)
{
AUD_Buffer buffer(buffersize * AUD_SAMPLE_SIZE(writer->getSpecs()));
sample_t* buf = buffer.getBuffer();
int len;
bool eos = false;
int channels = writer->getSpecs().channels;
for(unsigned int pos = 0; ((pos < length) || (length <= 0)) && !eos; pos += len)
{
len = buffersize;
if((len > length - pos) && (length > 0))
len = length - pos;
reader->read(len, eos, buf);
for(int i = 0; i < len * channels; i++)
{
// clamping!
if(buf[i] > 1)
buf[i] = 1;
else if(buf[i] < -1)
buf[i] = -1;
}
writer->write(len, buf);
}
}