- if(!
- DecoderSession_construct(
- &decoder_session,
-#ifdef FLAC__HAS_OGG
- options.common.is_ogg,
-#else
- /*is_ogg=*/false,
-#endif
- /*is_aiff_out=*/true,
- /*is_wave_out=*/false,
- options.common.continue_through_decode_errors,
- options.common.replaygain_synthesis_spec,
- analysis_mode,
- aopts,
- &options.common.skip_specification,
- &options.common.until_specification,
- options.common.has_cue_specification? &options.common.cue_specification : 0,
- infilename,
- outfilename
- )
- )
- return 1;
-
- if(!DecoderSession_init_decoder(&decoder_session, options.common, infilename))
- return DecoderSession_finish_error(&decoder_session);
-
- if(!DecoderSession_process(&decoder_session))
- return DecoderSession_finish_error(&decoder_session);
-
- return DecoderSession_finish_ok(&decoder_session);
-}
-
-int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options)
-{
- DecoderSession decoder_session;
-
- if(!
- DecoderSession_construct(
- &decoder_session,
-#ifdef FLAC__HAS_OGG
- options.common.is_ogg,
-#else
- /*is_ogg=*/false,
-#endif
- /*is_aiff_out=*/false,
- /*is_wave_out=*/true,
- options.common.continue_through_decode_errors,
- options.common.replaygain_synthesis_spec,
- analysis_mode,
- aopts,
- &options.common.skip_specification,
- &options.common.until_specification,
- options.common.has_cue_specification? &options.common.cue_specification : 0,
- infilename,
- outfilename
- )
- )
- return 1;
-
- if(!DecoderSession_init_decoder(&decoder_session, options.common, infilename))
- return DecoderSession_finish_error(&decoder_session);
-
- if(!DecoderSession_process(&decoder_session))
- return DecoderSession_finish_error(&decoder_session);
-
- return DecoderSession_finish_ok(&decoder_session);
-}
-
-int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, raw_decode_options_t options)
-{
- DecoderSession decoder_session;
-
- decoder_session.is_big_endian = options.is_big_endian;
- decoder_session.is_unsigned_samples = options.is_unsigned_samples;
+ FLAC__ASSERT(
+ options.format == FORMAT_WAVE ||
+ options.format == FORMAT_WAVE64 ||
+ options.format == FORMAT_RF64 ||
+ options.format == FORMAT_AIFF ||
+ options.format == FORMAT_AIFF_C ||
+ options.format == FORMAT_RAW
+ );
+
+ if(options.format == FORMAT_RAW) {
+ decoder_session.is_big_endian = options.format_options.raw.is_big_endian;
+ decoder_session.is_unsigned_samples = options.format_options.raw.is_unsigned_samples;
+ }