Stopping music OpenGL -
when run application, music being played when i'm using keyboard or mouse, stops , starts playing beginning. there can avoid stopping moment , let played in loop start till end no matter keyboard? i'm using winmm, got needed headers , linked lib. here's code:
playsound("audio.wav", null, snd_async|snd_filename|snd_loop);
playsound
not function want use this. it's primary use emitting short blips of sound, error notification or similar.
for things music or game sounds want program against directsound (windows), coreaudio (macos x), alsa or pulseaudio¹ (linux), oss (also linux , unixes).
however since such large plethora of apis, developers use audio framework provides unified api. popular choices are
- openal (does not deal reading sound files)
- sdl/sdl_mixer (no built in 3d sound, can open common audio formats)
- fmod (closed source, feature rich, popular among indie game developers)
- portaudio (no audio file support, no 3d sound, suited making existing audio infrastructure portable)
1: on personal note advise against using pulseaudio. pulseaudio has nice api , implements lots of great ideas, unfortunately i've yet come across linux system using pa sound not broken in some way. not pa's fault, whole problem of audio tricky , standard audio infrastructure (alsa) of linux, on pulseaudio depends on has fair share of problems itself.
writing quirks deal alsa trouble , broken (in sense sound hardware weird things) sound hardware managable , gives results quickly. writing quirks address problems resulting struggles between pa , broken audio hardware in audio client major effing nightmare.
Comments
Post a Comment