Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronisation ????

Status
Not open for further replies.

starn

Programmer
Mar 12, 2002
18
BE
Hi!!

I read 64 bytes from a file like this:

ifstream in ("music.wav", ios::in | ios::binary );
in.read (buffer,64);

What do I have to do to read these 64 bytes 192000 times a second? (192kHz)

It's to simulate an input that recieve sound samples at 192 kHz....

Thanks a lot for any help and sorry for my english :)

Starn
 
Don't know if this would be any good.

Check out QueryPerformanceCounter and when you know how it works you could do a check in the main loop in you prog if timepassed == 192,000th of a second then read next 64bytes from the file.

Thats the only thing I can think of off the top of my head, and only the performance counter is accurate enough for timing of this magnitude the timeGetTime() function only handles time in 1000th's of a second.

Does winm.lib or DirectMusic api's not have functionality for music timing??

I havn't looked that far into it.
Well hope this helps anyway.
 
Thanks for the help!

I'll check that :)

Starn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top