You can write MP3/Vorbis/Opus files with the BASSenc_MP3/OGG/OPUS add-ons (you will need BASSenc too), something like this:
encoder = BASS_Encode_MP3_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);
encoder = BASS_Encode_OGG_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);
encoder = BASS_Encode_OPUS_StartFile(stream, NULL, BASS_ENCODE_QUEUE | BASS_ENCODE_AUTOFREE, filename);
Please see each function's documentation for the options available.