Hi,

On Thu, 4 Oct 2001, Rickard Lind wrote:

> > The question of 'who takes responsibility for the buffer' should be
> > answered in the API docs here. My suggestion would be that either the
> > caller takes this responsibility, since we'll probably be using statical
> > buffers for OPL emu output, or that this can be chosen freely.
> > In the former case, the caller must be able to determine when a sound has
> > finished playing, so that it may release the resource lock for the
> > resource containing the sample. While this could be done with the
> > pcm_sample_getpos() call returning -1 (or whatever), this would require
> > continual polling to get this point. OTOH, this is also the 'safest' way
> > to do this, since it can be done in synchronity with the main
> > process/thread.
> 
> We could also make a funtion pcm_sample_play_onlyreturnwhenproperlydone

This would require a separate thread to wait for things to finish, and
still leave the synchronization problem. We can't halt the game just to
play a sound effect...

I believe that the polling approach will be adequate, though. The number
of PCMs we'll have playing simultaneously won't be very high (I don't
think SCI supported playing more than one simultaneously at all, at least
the earlier games most certainly don't), so the effort required for this
would be comparatively low. And it'd be easy to implement.

> > Should be handled at the mixer level, i.e. should be present here- some
> > sound hardware does not provide a hardware mixer, so we must not rely on
> > the sound driver to provide this functionality.
> 
> pcm_volume_set(volume)
> pcm_volume_get() return volume

OK.

> > Well, I like it; as far as I can tell, this handles our requirements quite
> > adequately. There is one problem I see as far as driver development is
> > concerned, though, and that problem is the callback funcion.
> > On systems where we have direct hardware control, it'll be easy to invoke
> > this from an IRQ handler. Unfortunately, we don't support any of these 
> > systems at this time. Do sound APIs provide this mechanism in general?
> 
> They should or they are not made for game programmers. (==fucked up) 

Now that I come to think of it, SDL provides this, too, so it should work
on some of the newer OSses.

llap,
 Christoph


Reply via email to