fluxtah

fluxtah

  • NA
  • 1
  • 0

Dynamic Stream Source

Dec 8 2003 7:38 AM
Hi fellow c#'ers! I am attempting to create an application that generates random beats (with some logic) from a wav file (prefereably a beat loop). The application takes the wav file and counts the total bytes of the data in the wav file. Once it knows the length it can calculate 16th's 32nd's etc. What my application needs to do is basically create a dynamic stream to send to the DirectSound buffer. The stream should be constructed from random parts of the wav file, basically the wav file is split into 16 equal parts(or start points for each part) and play from there to randomly generate a beat. The problem I have is, how do I create a stream at the same time as sending to the DirectSound buffer for play? The SecondaryBuffer can be loaded with a System.IO.Stream but I can not understand how I can manipulate the stream before it enters the DirectSound Buffer. This leads me to believe that I need to create a dynamic Stream. I may even need a pre-buffer, not sure. any help here would be very much appreciated. regards fluxtah