Index: roarclients/roarcatplay.c
===================================================================
--- roarclients/roarcatplay.c	(revision 5823)
+++ roarclients/roarcatplay.c	(revision 5949)
@@ -33,8 +33,13 @@
  printf("\nOptions:\n\n");
 
- printf("  --server SERVER    - Set server hostname\n"
-        "  --simple           - Use the simple interface (default)\n"
-        "  --verbose          - Use verbose output\n"
-        "  --help             - Show this help\n"
+ printf("  --server SERVER       - Set server hostname\n"
+        "  --simple              - Use the simple interface (default)\n"
+        "  --verbose             - Use verbose output\n"
+        "  --rate   -R RATE      - Set sample rate\n"
+        "  --bits   -B BITS      - Set bits per sample\n"
+        "  --chans  -C CHANNELS  - Set number of channels\n"
+        "  --codec  -E CODEC     - Set the codec\n"
+        "  --aiprofile PROFILE   - Set audio profile\n"
+        "  --help                - Show this help\n"
        );
 
@@ -42,8 +47,13 @@
 
 int main (int argc, char * argv[]) {
+ struct roar_audio_info info = {.rate = ROAR_RATE_DEFAULT,
+                                .bits = ROAR_BITS_DEFAULT,
+                                .channels = ROAR_CHANNELS_DEFAULT,
+                                .codec = ROAR_AUDIO_INFO_INVALID};
+ int    auinfo_changed = 0;
  const char * server   = NULL;
+ const char * file     = NULL;
  const char * k;
  int    i;
- const char * file    = NULL;
  int    verbose = 0;
  roar_vs_t * vss;
@@ -59,4 +69,24 @@
   } else if ( strcmp(k, "--verbose") == 0 || strcmp(k, "-v") == 0 ) {
    verbose++;
+  } else if ( strcmp(k, "-n") == 0 ) {
+   roar_debug_option_obsolete(argv[0], "-n", NULL, "Will ignore it for now.");
+  } else if ( !strcmp(k, "--rate") || !strcmp(k, "-R") ) {
+   info.rate = roar_str2rate(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) {
+   info.bits = roar_str2bits(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) {
+   info.channels = roar_str2channels(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) {
+   info.codec = roar_str2codec(argv[++i]);
+   auinfo_changed = 1;
+  } else if ( !strcmp(k, "--aiprofile") ) {
+   if ( roar_profile2info(&info, argv[++i]) == -1 ) {
+    fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error));
+    return 1;
+   }
+   auinfo_changed = 1;
   } else if ( strcmp(k, "--help") == 0 || strcmp(k, "-h") == 0 ) {
    usage();
@@ -74,8 +104,27 @@
   file = "fh:stdin";
 
- if ( (vss = roar_vs_new_from_file(server, "roarcatplay", file, &err)) == NULL ) {
-  ROAR_ERR("Can not start playback: %s", roar_error2str(err));
-  return 1;
+ if ( info.codec == ROAR_AUDIO_INFO_INVALID )
+  info.codec = ROAR_CODEC_DEFAULT;
+
+ if ( (vss = roar_vs_new(server, "roarcatplay", &err)) == NULL ) {
+  fprintf(stderr, "Error: can not connect to server: %s: %s\n",
+   server == NULL ? "(default)" : server, roar_error2str(err));
+  return 10;
  }
+
+ if ( auinfo_changed ) {
+  if ( roar_vs_stream(vss, &info, ROAR_DIR_PLAY, &err) == -1 ) {
+   fprintf(stderr, "Error: can not create new stream: %s\n", roar_error2str(err));
+   roar_vs_close(vss, ROAR_VS_TRUE, NULL);
+   return 10;
+  }
+ }
+
+ if ( roar_vs_file_simple(vss, file, &err) == -1 ) {
+  fprintf(stderr, "Error: can not open file: %s: %s\n", file, roar_error2str(err));
+  roar_vs_close(vss, ROAR_VS_TRUE, NULL);
+  return 10;
+ }
+
  roar_vs_run(vss, NULL);
  roar_vs_sync(vss, ROAR_VS_WAIT, NULL);
Index: roarclients/roarcatvio.c
===================================================================
--- roarclients/roarcatvio.c	(revision 5823)
+++ roarclients/roarcatvio.c	(revision 5949)
@@ -57,4 +57,6 @@
  const char * filename = NULL;
  int err;
+
+ roar_debug_bin_obsolete(argv[0], "roarcatplay", NULL);
 
  for (i = 1; i < argc; i++) {
