When I call the lock method for the secondary sound buffer, do I have to copy data over twice or is this what the two buffer pointers are for?
Does directsound divide up the secondary buffer for me when using streaming buffers and then only lock the portion that isn't being played...or do I have to copy to the first half and then to the second half depending which position event is fired?
Does directsound divide up the secondary buffer for me when using streaming buffers and then only lock the portion that isn't being played...or do I have to copy to the first half and then to the second half depending which position event is fired?
this thread would be better in the GAME section. Although directx is implemented as COM interfaces this is just a minor technical detail.
AFAIK directsound buffers can have callbacks setup so you will know when play cursor has reached near some fixed positions in the buffer.
You can use this as a circular buffer and fill it up behind what is currently singing
You can use this as a circular buffer and fill it up behind what is currently singing
let's say u have 100kB buffer
you lock 70kB from this buffer, starting at 70kB
then:
first pointer points to sub-buffer #1 (70kB-100kB)
second pointer points to sub-buffer#2 (0kB-40kB)
so u have 100kB locked in 2 sub-buffers
#1 - from designated point to end of buffer
#2 - from beginning to end of selection
you lock 70kB from this buffer, starting at 70kB
then:
first pointer points to sub-buffer #1 (70kB-100kB)
second pointer points to sub-buffer#2 (0kB-40kB)
so u have 100kB locked in 2 sub-buffers
#1 - from designated point to end of buffer
#2 - from beginning to end of selection