开发者

When should I allocate DirectSound buffers?

Please help me make up my mind.

  1. Allocate at the start of the application, free at the exit.
  2. Allocate when streaming starts, free as soon as streaming stops.

Which one? Why?

In case it matters: it's a voice communication application like Ekiga. I'm allocating the buffers with DSSCL_N开发者_StackOverflow中文版ORMAL (the 8bit 22KHz limitation is false as far as I've tested).


Since sound is CRITICAL to your application you should initialise it as soon as you are capable of displaying errors to the user. Otherwise you're making people wait through a startup sequence for an application they can't use.

On the other hand, if the ability to allocate is dependent on user settings then you should obviously allow them to reach the settings prior to doing something that could crash the application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜