Index: trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
===================================================================
--- trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp	(revision 88964)
+++ trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp	(revision 88967)
@@ -74,7 +74,4 @@
     /** Audio device to use. */
     PDMAUDIOHOSTDEV         Dev;
-    /** Absolute path where to store the test audio data.
-     *  If NULL, no test audio data will be written. */
-    char                   *pszPathOutAbs;
     /** How much to delay (wait, in ms) the test being executed. */
     RTMSINTERVAL            msDelay;
@@ -120,4 +117,6 @@
     /** The current (last) audio device enumeration to use. */
     PDMAUDIOHOSTENUM DevEnm;
+    /** The audio test set to use. */
+    AUDIOTESTSET     Set;
 } AUDIOTESTENV;
 /** Pointer a audio test environment. */
@@ -159,8 +158,9 @@
     VKAT_TEST_OPT_OUTDIR,
     VKAT_TEST_OPT_PAUSE,
-    VKAT_TEST_OPT_HZ,
-    VKAT_TEST_OPT_BIT,
-    VKAT_TEST_OPT_CHAN,
-    VKAT_TEST_OPT_SIGNED,
+    VKAT_TEST_OPT_PCM_HZ,
+    VKAT_TEST_OPT_PCM_BIT,
+    VKAT_TEST_OPT_PCM_CHAN,
+    VKAT_TEST_OPT_PCM_SIGNED,
+    VKAT_TEST_OPT_TAG,
     VKAT_TEST_OPT_VOL
 };
@@ -184,8 +184,9 @@
     { "--device",           VKAT_TEST_OPT_DEV,            RTGETOPT_REQ_STRING  },
     { "--pause",            VKAT_TEST_OPT_PAUSE,          RTGETOPT_REQ_UINT32  },
-    { "--pcm-bit",          VKAT_TEST_OPT_BIT,            RTGETOPT_REQ_UINT8   },
-    { "--pcm-chan",         VKAT_TEST_OPT_CHAN,           RTGETOPT_REQ_UINT8   },
-    { "--pcm-hz",           VKAT_TEST_OPT_HZ,             RTGETOPT_REQ_UINT16  },
-    { "--pcm-signed",       VKAT_TEST_OPT_SIGNED,         RTGETOPT_REQ_BOOL    },
+    { "--pcm-bit",          VKAT_TEST_OPT_PCM_BIT,        RTGETOPT_REQ_UINT8   },
+    { "--pcm-chan",         VKAT_TEST_OPT_PCM_CHAN,       RTGETOPT_REQ_UINT8   },
+    { "--pcm-hz",           VKAT_TEST_OPT_PCM_HZ,         RTGETOPT_REQ_UINT16  },
+    { "--pcm-signed",       VKAT_TEST_OPT_PCM_SIGNED,     RTGETOPT_REQ_BOOL    },
+    { "--tag",              VKAT_TEST_OPT_TAG,            RTGETOPT_REQ_STRING  },
     { "--volume",           VKAT_TEST_OPT_VOL,            RTGETOPT_REQ_UINT8   }
 
@@ -242,6 +243,8 @@
  * @param   pTstEnv             Audio test environment to initialize.
  * @param   pDrvAudio           Audio driver to use.
- */
-static void audioTestEnvInit(PAUDIOTESTENV pTstEnv, PPDMIHOSTAUDIO pDrvAudio)
+ * @param   pszPathOut          Output path to use. If NULL, the system's temp directory will be used.
+ * @þaram   pszTag              Tag name to use. If NULL, a generated UUID will be used.
+ */
+static int audioTestEnvInit(PAUDIOTESTENV pTstEnv, PPDMIHOSTAUDIO pDrvAudio, const char *pszPathOut, const char *pszTag)
 {
     RT_BZERO(pTstEnv, sizeof(AUDIOTESTENV));
@@ -250,5 +253,5 @@
     PDMAudioHostEnumInit(&pTstEnv->DevEnm);
 
-    return;
+    return AudioTestSetCreate(&pTstEnv->Set, pszPathOut, pszTag);
 }
 
@@ -264,4 +267,6 @@
 
     PDMAudioHostEnumDelete(&pTstEnv->DevEnm);
+
+    AudioTestSetDestroy(&pTstEnv->Set);
 }
 
@@ -274,4 +279,5 @@
 {
     RT_BZERO(pTstParms, sizeof(AUDIOTESTPARMS));
+
     return;
 }
@@ -286,7 +292,4 @@
     if (!pTstParms)
         return;
-
-    RTStrFree(pTstParms->pszPathOutAbs);
-    pTstParms->pszPathOutAbs = NULL;
 
     return;
@@ -609,5 +612,7 @@
     audioTestParmsInit(&TstCust);
 
-    char *pszDevice = NULL; /* Custom device to use. Can be NULL if not being used. */
+    char *pszDevice  = NULL; /* Custom device to use. Can be NULL if not being used. */
+    char *pszPathOut = NULL; /* Custom output path to use. Can be NULL if not being used. */
+    char *pszTag     = NULL; /* Custom tag to use. Can be NULL if not being used. */
 
     RT_ZERO(g_DrvIns);
@@ -709,9 +714,9 @@
             case VKAT_TEST_OPT_OUTDIR:
             {
-                TstCust.pszPathOutAbs = RTStrDup(ValueUnion.psz);
-                break;
-            }
-
-            case VKAT_TEST_OPT_BIT:
+                pszPathOut = RTStrDup(ValueUnion.psz);
+                break;
+            }
+
+            case VKAT_TEST_OPT_PCM_BIT:
             {
                 TstCust.ToneParms.Props.cbSampleX = ValueUnion.u8 / 8 /* bit */;
@@ -719,5 +724,5 @@
             }
 
-            case VKAT_TEST_OPT_CHAN:
+            case VKAT_TEST_OPT_PCM_CHAN:
             {
                 TstCust.ToneParms.Props.cChannelsX = ValueUnion.u8;
@@ -725,5 +730,5 @@
             }
 
-            case VKAT_TEST_OPT_HZ:
+            case VKAT_TEST_OPT_PCM_HZ:
             {
                 TstCust.ToneParms.Props.uHz = ValueUnion.u32;
@@ -731,7 +736,13 @@
             }
 
-            case VKAT_TEST_OPT_SIGNED:
+            case VKAT_TEST_OPT_PCM_SIGNED:
             {
                 TstCust.ToneParms.Props.fSigned = ValueUnion.f;
+                break;
+            }
+
+            case VKAT_TEST_OPT_TAG:
+            {
+                pszTag = RTStrDup(ValueUnion.psz);
                 break;
             }
@@ -771,12 +782,16 @@
         /* For now all tests have the same test environment. */
         AUDIOTESTENV TstEnv;
-        audioTestEnvInit(&TstEnv, pDrvAudio);
-
-        PPDMAUDIOHOSTDEV pDev;
-        rc = audioTestDevicesEnumerateAndCheck(&TstEnv, pszDevice, &pDev);
+        rc = audioTestEnvInit(&TstEnv, pDrvAudio, pszPathOut, pszTag);
         if (RT_SUCCESS(rc))
-            audioTestWorker(&TstEnv, &TstCust);
-
-        audioTestEnvDestroy(&TstEnv);
+        {
+            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Output directory is '%s'\n", TstEnv.Set.szPathOutAbs);
+
+            PPDMAUDIOHOSTDEV pDev;
+            rc = audioTestDevicesEnumerateAndCheck(&TstEnv, pszDevice, &pDev);
+            if (RT_SUCCESS(rc))
+                audioTestWorker(&TstEnv, &TstCust);
+
+            audioTestEnvDestroy(&TstEnv);
+        }
         audioTestDrvDestruct(pDrvReg, &g_DrvIns);
     }
@@ -785,4 +800,6 @@
 
     RTStrFree(pszDevice);
+    RTStrFree(pszPathOut);
+    RTStrFree(pszTag);
 
     /*
