none
SinkWriter with Audio Renderer (SAR) RRS feed

  • Question

  • Hey guys.  I have been reading up on Media Foundation for well over a month now, and I am getting frustrated because it seems to add a lot more overhead than what I want.  Basically I have created a couple of interfaces that will record and save all the information from the Kinect.  Now I am at  the point where I want to open the file and display/stream the video and audio data.  I have the code that works fine for displaying the video data (i use a Qt's framework with OpenGL displays), so i have a custom thread that just reads the frames and pumps the data out in the specified intervals.  My problem that I cannot seem to find an easy solution to is rendering the audio out to the speakers.  Because my openGL windows need access to these buffers in order to display them (It displays the audio waveform as well - this is already functional), I don't want to use a MediaSession and create a whole pipeline.  So I recently found the sourceReader and sinkWriter interfaces.  These seems to be perfect for what I need to do, which is basically just get an interface that I can pump raw audio data into a buffer than gets rendered at a specified sample rate, etc.  My question is:  Can I use a sinkWriter that uses a SAR as it's mediaSink?  From all the examples and documentation I have read, they only deal with writing the data to files.  I don't want to write it to a file, I want to send it to a renderer.  My Kinect interface already deals with the timing, so All I want is something that takes the raw data I pump in and spits it out of the speakers (or audio device).  The Kinect data is 16-bit, 16KHz sampling rate, and the data is saved raw.  Any suggestions would be greatly appreciated as I can't seem to find a direct answer to what seems like should be a relatively simple task.

    Thanks!

    Thursday, August 9, 2012 3:23 PM

All replies