Re: Reading audio samples

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Tue, 21 Mar 2006 15:51:38 +0100, nicolasr wrote:

Question 1: is it possible to set start and stop positions such that
I always get at least the requested number of samples? (The exceeding
samples could be stored in a buffer for the next reading
operation then). Is there a way to calculate the needed stop position?
I guess I would have to know the compression block size in advance?

Just round up 1 second or stop once you've counted the correct number of
samples.


I tried to add one second to the requested amount of data. I then use
IMediaSeeking::SetPositions() and IMediaControl::Run(), of course
without clock. It all seems to work fine the only problem is, however:
when I want to continuously read from the file my Read() function
needs to call SetPositions() every time to set the new stop position.
SetPositions() does only seem to work when the graph is stopped
and calling Run()/Stop() all the time seems to be slow. Pause() does
not allow me to set the new end position, can you confirm this, or am
I doing something wrong here?

Pausing should let you set a new start position, but I'm not sure about
stop position as I never use those. Perhaps you can use the other
mechanism we discussed so that you can use pause instead of stop.

At least for a standard wave file my old MMIO API code reads the file
6 times faster than my current DShow test code.

That will always be the fastest but the difference shouldn't be that great
once you get everything working right.

--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
.



Relevant Pages

  • Re: Reading audio samples
    ... samples could be stored in a buffer for the next reading ... needs to call SetPositions() every time to set the new stop position. ... At least for a standard wave file my old MMIO API code reads the file ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: Pre-buffering in Dshow
    ... COutputQueue) and wait in pause till its done...... ... source filter, which is a push model source filter. ... Renderers do not complete the ... source filter until you have reached a certain buffer level. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: cin.get() does not work if there is a previous cin?
    ... >According to Josuttis, 'sync' will sync the buffer, ... >it clears characters from the buffer. ... >inline void Pause() ... Dietmar Khuel, Angelica Langer and Nico Josuttis, I still failed to find ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Purging print job problems.
    ... Some printers have a control panel that will allow you to pause the job at ... also be able to also flush the printer spool buffer. ... and the other via a wireless print server. ... Is there anyway to manually dlete things ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Masters Slideshow in a Flash!
    ... slideshow into a more viewable format. ... You may have to pause it and let it buffer in for a few seconds. ...
    (rec.sport.golf)