psi icon indicating copy to clipboard operation
psi copied to clipboard

Help using ExportAudioToWavFileTask to export multiple audio streams as one .wav file

Open HannahBruch opened this issue 7 months ago • 1 comments

Hi, I'm using this teams bot to record call audio for multiple people in MS Teams. I've been able to export each stream to it's own .wav, but I want to export them all to one file that accurately recreates the audio from the teams call. I tried using ExportAudioToWaveFileTask but I am clearly using it wrong. Here's my code, which currently throws System.Exception: 'Stream specification not found: Audio' on the last line

        const string storeName = "test_audio";
        const string path = "C:\\\\store";
        string filePath = Path.Join(path, storeName);
        using Pipeline pipeline = Pipeline.Create();
        PsiStoreStreamReader reader = new PsiStoreStreamReader(storeName, path);
        PsiExporter exporter = PsiStore.Create(pipeline, $"{storeName}_temp", null, false, null);
        var streams = reader.AvailableStreams;
        Dataset dataset = Dataset.CreateAsync(reader).Result;
        dataset.AddSessionAsync(reader);
        ExportAudioToWavFileTask task = new ExportAudioToWavFileTask{};
        var config = new ExportAudioToWavFileTaskConfiguration();
        SessionImporter sessionImporter = SessionImporter.Open(pipeline, dataset.Sessions.First());
        
        task.Run(pipeline, sessionImporter, exporter, config);

HannahBruch avatar Mar 03 '25 04:03 HannahBruch