2

..As above. I am looking for a way to read an audio stream in c# (or c++, that I can convert to a dll and marshall it) and get the Linear Time Code data as Hour:Minute:Second:Frame.

I have found a c# port that uses libltc (https://github.com/x42/libltc) The lib and dll build fine, but the c# code crashes on a Wasapi recording function.

var waveIn = new WasapiCapture();
            waveIn.WaveFormat = new WaveFormat(44100, 8, 2);

            Console.WriteLine("Device format: " + waveIn.WaveFormat.ToString());
            FDecoder = new LTCSharp.Decoder(waveIn.WaveFormat.SampleRate, 25, 32);
            waveIn.DataAvailable += waveIn_DataAvailable;

            waveIn.StartRecording();  //crashes here 

The error is:

Unhandled Exception: System.ArgumentException: Unsupported Wave Format
   at NAudio.CoreAudioApi.WasapiCapture.InitializeCaptureDevice()
   at NAudio.CoreAudioApi.WasapiCapture.StartRecording()

Fine, it's an unsupported format. (An LTC streamed timecode signal)

How can I get around this? Has anyone written a timecode reader in C#?

Thanks.

anti
  • 3,011
  • 7
  • 36
  • 86

0 Answers0