-#define FORMAT_TEXT N_("output format")
-#define FORMAT_LONGTEXT N_("one of \"u8\", \"s8\", \"u16\", \"s16\", " \
- "\"u16_le\", \"s16_le\", \"u16_be\", " \
- "\"s16_be\", \"fixed32\", \"float32\" or \"spdif\"")
-#define WAV_TEXT N_("add wave header")
-#define WAV_LONGTEXT N_("instead of writing a raw file, you can add a wav " \
- "header to the file")
-
-static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
- "u16_be", "s16_be", "fixed32", "float32",
- "spdif", NULL };
-static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
- VLC_FOURCC('s','8',' ',' '),
- AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
- VLC_FOURCC('u','1','6','l'),
- VLC_FOURCC('s','1','6','l'),
- VLC_FOURCC('u','1','6','b'),
- VLC_FOURCC('s','1','6','b'),
- VLC_FOURCC('f','i','3','2'),
- VLC_FOURCC('f','l','3','2'),
- VLC_FOURCC('s','p','i','f') };
-
-#define FILE_TEXT N_("output file")
-#define FILE_LONGTEXT N_("file to which the audio samples will be written to")
-
-vlc_module_begin();
- add_category_hint( N_("Audio"), NULL, VLC_FALSE );
- add_string_from_list( "audiofile-format", "s16", format_list, NULL,
- FORMAT_TEXT, FORMAT_LONGTEXT, VLC_TRUE );
- add_file( "audiofile", "audiofile.wav", NULL, FILE_TEXT,
- FILE_LONGTEXT, VLC_FALSE );
- add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, VLC_TRUE );
- set_description( N_("file audio output module") );
- set_capability( "audio output", 0 );
- add_shortcut( "file" );
- add_shortcut( "audiofile" );
- set_callbacks( Open, Close );
-vlc_module_end();
+#define FORMAT_TEXT N_("Output format")
+#define FORMAT_LONGTEXT N_("One of \"u8\", \"s8\", \"u16\", \"s16\", " \
+ "\"u16_le\", \"s16_le\", \"u16_be\", \"s16_be\", \"fixed32\", " \
+ "\"float32\" or \"spdif\"")
+#define CHANNELS_TEXT N_("Number of output channels")
+#define CHANNELS_LONGTEXT N_("By default, all the channels of the incoming " \
+ "will be saved but you can restrict the number of channels here.")
+
+#define WAV_TEXT N_("Add WAVE header")
+#define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
+ "header to the file.")
+
+static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
+ "s16_le", "u16_be", "s16_be", "fixed32",
+ "float32", "spdif" };
+static const int format_int[] = { VLC_CODEC_U8,
+ VLC_CODEC_S8,
+ VLC_CODEC_U16N, VLC_CODEC_S16N,
+ VLC_CODEC_U16L,
+ VLC_CODEC_S16L,
+ VLC_CODEC_U16B,
+ VLC_CODEC_S16B,
+ VLC_CODEC_FI32,
+ VLC_CODEC_FL32,
+ VLC_CODEC_SPDIFL };
+
+#define FILE_TEXT N_("Output file")
+#define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
+
+vlc_module_begin ()
+ set_description( N_("File audio output") )
+ set_shortname( N_("File") )
+ set_category( CAT_AUDIO )
+ set_subcategory( SUBCAT_AUDIO_AOUT )
+
+ add_string( "audiofile-format", "s16", NULL,
+ FORMAT_TEXT, FORMAT_LONGTEXT, true )
+ change_string_list( format_list, 0, 0 )
+ add_integer( "audiofile-channels", 0, NULL,
+ CHANNELS_TEXT, CHANNELS_LONGTEXT, true )
+ add_file( "audiofile-file", "audiofile.wav", NULL, FILE_TEXT,
+ FILE_LONGTEXT, false )
+ add_bool( "audiofile-wav", true, NULL, WAV_TEXT, WAV_LONGTEXT, true )
+
+ set_capability( "audio output", 0 )
+ add_shortcut( "file" )
+ add_shortcut( "audiofile" )
+ set_callbacks( Open, Close )
+vlc_module_end ()