When I run a copy of Lame I downloaded from Rarewares, and attempt to encode a file that's not supported, the program returns a non-zero value, showing that there was an error.
c:\Media\Flac>lame metaflac.exe
Warning: unsupported audio format
c:\Media\Flac>echo %errorlevel%
1
c:\Media\Flac>
Running the copy of Lame from that includes the libsndfile library, though, it will encode anything, and return 0, indicating success.
c:\Media\Flac>lame metaflac.exe
LAME 3.98.4 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding metaflac.exe to metaflac.exe.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
89/89 (100%)| 0:00/ 0:00| 0:00/ 0:00| 24.733x| 0:00
-------------------------------------------------------------------------------
kbps LR MS % long switch short %
128.0 12.4 87.6 76.4 9.0 14.6
Writing LAME Tag...done
ReplayGain: -11.8dB
c:\Media\Flac>echo %errorlevel%
0
c:\Media\Flac>
I'd really appreciate it if this copy of Lame threw an error, or at least returned a non-zero value, if it finds non-audio data. Is this feasible?