Re: Correlating SecondaryBuffer PlayCursor Position and Time in VB.NET



On Mon, 18 Apr 2005 21:09:51 GMT, Chrisbot.com wrote:

> I see. I'm glad we are having this conversation. There are some basic
> concepts I'm having trouble with.
>
> So the play cursor cannot be moved programmatically. What are the steps to
> load a wav into a SecondaryBuffer at the cursor?

Sorry for the confusion. You can set the cursor position on a secondary
buffer, but it does not work 100% correct in all environments - therefore I
usually discount it. It seems to be viable if only software buffers are
used, I think it also works better in the managed implementation. In your
case I don't think it is necessarily a good idea as you will have timing
issues attempting to stop in the correct place.

Look at the C++ StreamData sample, there is no .NET sample for this
unfortunately. This sample loads a wave file in to the buffer one piece at
a time continously until the file is done.

If your file has distinct segments, and is relatively small, I recommend
reading into memory and breaking it into distinct buffers. If the number
of segments is reasonable, create a secondary buffer for each segment.
Make sure the looping flag is not set if you want it to automatically stop
at the end, use a notification object to get notified when it hits the end
of the buffer.
.



Relevant Pages

  • [QUIZ] Editing Text (#145)
    ... The three rules of Ruby Quiz: ... Have you ever wondered how a text buffer might be represented in a text editor ... All of the basic operations occur around a text cursor. ...
    (comp.lang.ruby)
  • dynamic class members workaround
    ... I have a generic buffer class, which can have one or more cursor ... The parent buffer of pCursor is implicit at the Insertcall, ... dynamic member for each cursor. ...
    (comp.lang.cpp)
  • Re: Interesting coding idea
    ... >Perhaps it would be interesting to program a virtual machine simulating ... checkability for no-longer-valid d or old automatic) segments). ... possibly on invalid pointer-to-pointer conversions if it's done right). ... if they're given a buffer that's smaller than the buffer size argument, ...
    (comp.lang.c)
  • Re: Interesting coding idea
    ... >Perhaps it would be interesting to program a virtual machine simulating ... checkability for no-longer-valid d or old automatic) segments). ... possibly on invalid pointer-to-pointer conversions if it's done right). ... if they're given a buffer that's smaller than the buffer size argument, ...
    (comp.programming)
  • Re: Secondary buffer? where is it
    ... ok now i am aven more confused lol I went back to my project and i have this ... SecondaryBuffer again, as in it knows what the type is. ... i am using MDX 10 and had written a dxSound class in previous versions. ... written 4 days ago on MSDN and they used Secondary buffer? ...
    (microsoft.public.win32.programmer.directx.audio)

Loading