https://gitlab.synchro.net/main/sbbs/-/commit/afd4fcd2f951275817649276
Modified Files:
exec/load/cterm_lib.js
Log Message:
cterm_lib: add supports_audio_format(), the per-format libsndfile query
supports_audio_files() answers whether the client HAS libsndfile, not whether it reads your format -- so a door offering MP3 had no way to find out, and an MP3 that the client's libsndfile is too old to decode fails at the far end
with the BBS none the wiser.
CTerm 1.331 added Q;libsndfileFormat;pm;ps, which answers from libsndfile's
own sf_format_check() and is therefore authoritative for the process actually playing the sound. Wrap it, with the normalized major/subtype IDs from cterm.adoc's registry (audio_major_ogg/audio_sub_opus and friends) so a caller doesn't hand-derive them from SF_INFO.format.
Returns undefined -- "unknown", not "unsupported" -- when the question cannot be asked: no libsndfile, or a CTerm older than 1331, where the query does not exist and the terminal simply stays silent. A door that must not guess wrong
on an old client still wants WAV or OGG.
The module comment claimed "there is no per-format probe". That was true
before 1.331; it has been wrong since, and it is what the SyncRetro lobby's format advice was written from. The C door has queried this since termgfx's Opus support (termgfx_audio_opus_query); this is the JS side of the same question, and it sends a byte-identical query string.
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)