Allow building without soundfile libraries.

Emit error message if soundfile source is requested.
This commit is contained in:
Holger Vogt 2026-05-10 16:35:28 +02:00
parent 7cba7ddee0
commit 201ae8cac7
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,7 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
break;
case VSRC_SOUND: {
#if defined(HAVE_LIBSNDFILE) && defined(HAVE_LIBSAMPLERATE)
int id, channel;
double oversampling;
here->VSRCfunctionType = SOUND;
@ -315,6 +316,10 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
oversampling = here->VSRCcoeffs[5];
vsjack_open(id, jfile, channel, oversampling);
tfree(jfile);
#else
fprintf(stderr, "\nError: ngspice is compiled without soundfile support!\n");
controlled_exit(EXIT_BAD);
#endif
}
break;