From ef3acaedc1eb530b263e9235d83d853f8282a278 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 28 Apr 2012 13:16:29 +0000 Subject: Audio: * Fix for [#31099] Audio in Meta-Strips Plays Beyond Strip Cut * Adding a split files option to the mixdown operator which then renders each channel into a separate file --- source/blender/editors/sound/sound_ops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/sound') diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index c238789446f..49eb85d62b4 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -318,6 +318,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op) char filename[FILE_MAX]; Scene *scene; Main *bmain; + int split; int bitrate, accuracy; AUD_DeviceSpecs specs; @@ -333,6 +334,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op) specs.format = RNA_enum_get(op->ptr, "format"); container = RNA_enum_get(op->ptr, "container"); codec = RNA_enum_get(op->ptr, "codec"); + split = RNA_boolean_get(op->ptr, "split_channels"); scene = CTX_data_scene(C); bmain = CTX_data_main(C); specs.channels = scene->r.ffcodecdata.audio_channels; @@ -341,8 +343,12 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op) BLI_strncpy(filename, path, sizeof(filename)); BLI_path_abs(filename, bmain->name); - result = AUD_mixdown(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS, - accuracy, filename, specs, container, codec, bitrate); + if(split) + result = AUD_mixdown_per_channel(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS, + accuracy, filename, specs, container, codec, bitrate); + else + result = AUD_mixdown(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS, + accuracy, filename, specs, container, codec, bitrate); if (result) { BKE_report(op->reports, RPT_ERROR, result); @@ -590,6 +596,7 @@ static void SOUND_OT_mixdown(wmOperatorType *ot) RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec"); RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format"); RNA_def_int(ot->srna, "bitrate", 192, 32, 512, "Bitrate", "Bitrate in kbit/s", 32, 512); + RNA_def_boolean(ot->srna, "split_channels", 0, "Split channels", "Each channel will be rendered into a mono file."); #endif // WITH_AUDASPACE } -- cgit v1.2.3