English 中文(简体)
只提供听力的“直接驱动源”过滤器的正确抽样规模是什么?
原标题:What is the correct sample size for a DirectShow push source filter that provides only audio?

我有一个Delphi 6方案,利用DSPACK图书馆直接过滤工作。 我正在创建我的第一个普什源过滤器,提供来自习俗视听来源的录音。 目前,我的最大问题是,如何确定我在FillBuffer(电话)中将复制到Fileter输出缓冲处的数据数量。

Do I really copy only one audio sample at a time? This would be a mere 2-bytes in my case since each audio sample is 16-bits wide, single-channel. This seems radically inefficient. Or do I copy a block of samples at once, and if so, what is the correct logic to use in determining how many bytes to copy? Is the correct logic to simply use the value returned by Sample.GetSize() as the number of bytes to provide, where Sample is the IMediaSample object passed in to the FillBuffer() call?

另外,如果任何人在制作音响推进源过滤器和录像带方面有任何疏漏或警告,请在座标。 我正在做的样本是录像过滤器,该过滤器将目前的桌面图像作为一系列的轨道图。 我担心的是,在把视频过滤器作为我的起点时,我将做一些不适当的事情。 此外,这一过滤器的音频必须是实时的,因为它涉及两个当事人之间的直播联系。

问题回答

Do I really copy only one audio sample at a time? This would be a mere 2-bytes in my case since each audio sample is 16-bits wide, single-channel. This seems radically inefficient. Or do I copy a block of samples at once...

你们一劳永逸地翻了一番。 事实上,由于你拥有上游/源过滤器,正是由谁生成数据。 因此,您的过滤器正在请求在产出胎盘上配备一个附属的记忆分配器,使你有一个新的缓冲,以掌握数据。 你获得缓冲,而且你有能力,如Ntes。 你可以自由地按照你的意愿,把更多或更少的样本带入缓冲地带,只有少数 by或尽可能多。

To avoid complications, you should be filling data at block alignment, specific to media type. With audio it s typically WAVEFORMATEX::nBlockAlign value. Still even not doing this might be OK for certain peer filter which would buffer data internally and handle alignment themselves. Also with good alignment it would be easier to attach correct time stamps to the data.





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签