/****************************************************************************** * SILENCE.CMD * * * * This REXX script creates a brief (5 second, 48 KHz) WAV file consisting of * * nothing but silence, suitable for subsequently multiplexing into a DVD * * menu as its audio track. For example: * * * * Create SILENCE.WAV: * * silence.cmd * * * * Convert to DVD AC3 format (creates MENU_AUDIO.AC3): * * ffmpeg -i silence.wav -ab 224 -ar 48000 menu_audio.ac3 * * * * Multiplex into menu video file MENU_BG.M2V (creates MENU_BG.MPG): * * mplex -f 8 -o menu_bg.mpg menu_bg.m2v menu_audio.ac3 * * * * Generously provided by Don Hills; minor modifications by Alex Taylor. * ******************************************************************************/ file_name = 'SILENCE.WAV' file_time = 5 /*** seconds ***/ wav_type = 1 /*** PCM ***/ mono_stereo = 2 /*** Stereo ***/ sample_rate = 48000 /*** 48 KHz ***/ sample_bits = 16 /*** bits per sample ***/ byte_rate = mono_stereo * sample_rate * (sample_bits % 8) data_size = file_time * byte_rate file_size = data_size + 36 call charout file_name, 'RIFF' call charout file_name, reverse(right(d2c(file_size),4,'00'x)) call charout file_name, 'WAVE' call charout file_name, 'fmt ' call charout file_name, reverse(right(d2c(16),4,'00'x)) call charout file_name, reverse(right(d2c(wav_type),2,'00'x)) call charout file_name, reverse(right(d2c(mono_stereo),2,'00'x)) call charout file_name, reverse(right(d2c(sample_rate),4,'00'x)) call charout file_name, reverse(right(d2c(byte_rate),4,'00'x)) call charout file_name, '0000'x /*** block alignment padding ***/ call charout file_name, reverse(right(d2c(sample_bits),2,'00'x)) call charout file_name, 'data' call charout file_name, reverse(right(d2c(data_size),4,'00'x)) call charout file_name, left('',data_size,'00'x) exit;