views:

45

answers:

1

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_NORMAL (the 8bit 22KHz limitation is false as far as I've tested).

A: 

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.

SpliFF