Show a warning when file renderer is use with more than one stereo channel (#1028)

Resolves #1026
This commit is contained in:
Tom M 2022-01-16 14:33:52 +01:00 committed by GitHub
parent 3229899a34
commit b7a0264459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,6 +199,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
double samplerate; double samplerate;
int retval; int retval;
#endif #endif
int audio_channels;
char *filename = NULL; char *filename = NULL;
fluid_file_renderer_t *dev; fluid_file_renderer_t *dev;
@ -233,6 +234,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
} }
fluid_settings_dupstr(synth->settings, "audio.file.name", &filename); fluid_settings_dupstr(synth->settings, "audio.file.name", &filename);
fluid_settings_getint(synth->settings, "synth.audio-channels", &audio_channels);
if(filename == NULL) if(filename == NULL)
{ {
@ -310,6 +312,11 @@ new_fluid_file_renderer(fluid_synth_t *synth)
#endif #endif
if(audio_channels != 1)
{
FLUID_LOG(FLUID_WARN, "The file-renderer currently only supports a single stereo channel. You have provided %d stereo channels. Audio may sound strange or incomplete.", audio_channels);
}
FLUID_FREE(filename); FLUID_FREE(filename);
return dev; return dev;