示例#1
0
 private void SetupAudioStreams(int dataFileSize)
 {
     AudioFileInStream = new FileInDecodingStream();
     //AudioFileInStream.InfoOutFile = InfoFileWriter;
     AudioFileInStream.Initialize(AudioFileName);
     AudioFileInStream.ProcessSingle();
     AudioFileInStream.ClearReadData();
     SetupOutputStream(dataFileSize);
     AudioFileInStream.Reset();
     AudioFileInStream.MetadataCallback = NLSBSteganographerEncoder.MetadataCallback;
     AudioFileInStream.Initialize(AudioFileName);
     AudioFileInStream.ProgressCallback = ProgressCallback;
     MainWorkerThread = new Thread(new ParameterizedThreadStart(x => { Encoder.ProcessFile(WriteCallback); CleanupEncoder(); }));
 }
示例#2
0
        private void SetupDecoder(out Stream dataFileStream)
        {
            AudioFileInStream             = new FileInDecodingStream();
            AudioFileInStream.InfoOutFile = InfoFileWriter;
            AudioFileInStream.SetMetadataRespond(MetadataType.VorbisComment);
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "All Files (*.*)|*.*";
            dlg.ShowDialog();
            if (dlg.FileName == "")
            {
                dataFileStream = null;
                return;
            }
            dataFileStream = new StreamWriter(dlg.FileName).BaseStream;
            Decoder        = new NLSBSteganographerDecoder(
                AudioFileInStream,
                dataFileStream,
                KeyHelper.GenerateKeyFromUserInput()
                );
            AudioFileInStream.Initialize(AudioFileName);
            AudioFileInStream.ProgressCallback = ProgressCallback;
            MainWorkerThread = new Thread(new ParameterizedThreadStart(x => { Decoder.ProcessFile(); CleanupDecoder(); }));
        }