Lazarus

Programming => Graphics and Multimedia => Audio and Video => Topic started by: pcurtis on May 18, 2021, 04:33:48 pm

Title: [SOLVED] Initialize MMSystem
Post by: pcurtis on May 18, 2021, 04:33:48 pm
When I first play a sound with  PlaySound(WavStream.Memory, 0, SND_NODEFAULT or SND_ASYNC or SND_MEMORY); there is a small delay +/- 200ms while MMSystem initializes, if I play again the delay is gone.
How can I initialize the MMSystem when I start the app?
Title: Re: Initialize MMSystem
Post by: lucamar on May 18, 2021, 04:54:11 pm
It has been a long time but IIRC there is no "global" initialization per se, but if you call any of its functions at the start of the program (say, waveOutGetDevCaps()) the delay should (mostly) dissapear.

Though note that there will always be some delay the first time you play a new sound due to the internal initializations needed.
Title: Re: Initialize MMSystem
Post by: pcurtis on May 18, 2021, 05:14:49 pm
OK, thanks I'll try.
Title: Re: Initialize MMSystem
Post by: pcurtis on May 18, 2021, 07:36:44 pm
OK, it helps. Thanks.
TinyPortal © 2005-2018