Пример #1
0
 /**
  * <summary>audioFileStream must be initialized prior to passing
  * dataFileStream must be open prior to passing</summary>
  */
 public NLSBSteganographerEncoder(FileInDecodingStream audioFileStream, Stream dataFileStream, byte[] key, int dataFileSize)
 {
     if ((audioFileStream.GetTotalSamples() * audioFileStream.GetChannels()) < ((uint)dataFileSize * 8))
     {
         throw new InsufficientAudioException();
     }
     AudioFileStream = audioFileStream;
     AudioFileStream.MetadataCallback = MetadataCallback;
     DataFileStream = dataFileStream;
     for (int i = 0; i < dataFileSize * 8; i++)
     {
         BitPermutationIndices.Add(i);
     }
     Rng = new KeyedRng(key);
 }
Пример #2
0
 private void WriteCallback(int[] toWrite)
 {
     AudioFileOutStream.ProcessInterleaved(toWrite, (uint)toWrite.Length / AudioFileInStream.GetChannels());
 }