CD tracks in my game..
I am lost as to how I can play tracks on my game''s CD in-game.. Or even how to set off timed music events. Anyone have any help?
Check out the Windows multimedia functions:
mciSendString() or mciSendCommand().
Typically you send strings like:
"open cdaudio"
"play cdaudio from 1 to 2"
However I''ve found that the notify option works pretty bad (at least it won''t work on all cd-players, so you should use a timer or something instead.
Another problem is the spin-up time of some cd-players that may halt the computer before the disc has reached the required velocity...
There''s an easy fix I wish more gamedevelopers would do (of course fewer and fewer use cd-audio, which is bad since it takes very little CPU-time), just let the cd-player repeatedly play a silent track while no other music should be playing.
mciSendString() or mciSendCommand().
Typically you send strings like:
"open cdaudio"
"play cdaudio from 1 to 2"
However I''ve found that the notify option works pretty bad (at least it won''t work on all cd-players, so you should use a timer or something instead.
Another problem is the spin-up time of some cd-players that may halt the computer before the disc has reached the required velocity...
There''s an easy fix I wish more gamedevelopers would do (of course fewer and fewer use cd-audio, which is bad since it takes very little CPU-time), just let the cd-player repeatedly play a silent track while no other music should be playing.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement