ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://ioquake3.org/
GNU General Public License v2.0
2.4k stars 529 forks source link

Warning when exporting video, resulting avi without sound #565

Open The-Gig opened 2 years ago

The-Gig commented 2 years ago

Hello, this is an issue another user pointed out to me, so I tested it and I experienced it too. Using /video command to output a demo to an avi file, with the latest ioquake3 binaries I found (ioq3 1.36_GIT4003a5b-2021-03-17), I see "WARNING: Audio format of 32bit/2 channels not supported"_ in console history. The resulting .avi file does not have audio. Tested on Windows 10 64bit Note for testing: in case you are using it, you need to disable OpenAL first (s_useopenal 0;snd_restart), as OpenAL mode isn't supported for exporting the sound into video files (but that's a different warning message).

I also tested with the old ioq3 1.36 from many years ago, and got no warning in console history there, and the audio has been exported as expected.

zturtleman commented 2 years ago

SDL 2.0.6 changed the default Windows audio API from DirectSound to the newer WASAPI. ioquake3 AVI recording only supports 16-bit integer audio samples but WASAPI prefers 32-bit floating point. Floating point vs integer samples is not noted in the warning.

ioquake3 allows SDL to change the audio format to whatever it prefers with no option to force using 16-bit integer samples. (Though it is possible at the source code level using different flags for SDL_OpenAudioDevice()).

Ideally support for 32-bit floating point samples would be added to AVI recording. (I don't know if it should write float samples or convert to 16-bit integer samples.)

It may be possible to work around the issue by forcing SDL to use DirectSound using an environment variable. (Untested) in a command prompt or .bat file run;

set SDL_AUDIODRIVER=directsound
ioquake3.x86_64.exe