[Vorbis] c# source to interop call vorbisfile.dll

illiminable ogg at illiminable.com
Thu Jun 9 01:56:54 PDT 2005


I always find it easier to wrap native code inside C++.NET managed code... so you can expose the managed interface and C++.NET lets you run native code within that code. I don't like using interop for porting entire API's... it's mainly good for one off function calls.

You problem is probably because you are trying to get a native callback to invoke a managed one.

You can find various utility functions to help with exposing native code to managed code here.
http://svn.xiph.org/trunk/oggdsf/src/lib/helper/libiWrapper/

If you go up a few directories and have a look around there's several examples of other native code being exposed to .NET in this way (look for directories ending in DotNET).

Specifically for the callback problem you need a callback proxy.

An example of one is here
http://svn.xiph.org/trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
http://svn.xiph.org/trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h

Incidentally that library libDSPlay is a ready made .NET media player class... if you install my ogg codecs from www.illiminable.com/ogg/ you can use that .NET class to play any media file on windows including all the ogg files ie speex, vorbis flac and theora.

Zen.
  ----- Original Message ----- 
  From: Langley, Adam 
  To: vorbis at xiph.org 
  Sent: Thursday, June 09, 2005 9:56 AM
  Subject: [Vorbis] c# source to interop call vorbisfile.dll


  Hi,

   

  Can anyone tell me where I can get sample C# code to call the native (win32) dll vorbisfile.dll to decode a vorbis Stream?

  I want the native performance of this methodology, however Ive tried porting the invocation code to C# and keep getting null reference errors when

  Calling ov_open_callback.

   

  Thanks

   

   - Adam



------------------------------------------------------------------------------


  _______________________________________________
  Vorbis mailing list
  Vorbis at xiph.org
  http://lists.xiph.org/mailman/listinfo/vorbis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20050609/fca746fd/attachment.htm


More information about the Vorbis mailing list