<div>It&#39;s not so much a matter of interface as a matter of the complex data structures used by the library. To call a C or C++ library, you have to map the data types used by the interface to something that .NET can manipulate, 
i.e., .NET types. It is pretty easy to do for simple types or structures, but it becomes a nightmare when you deal with nested structs and unions.</div>
<div>&nbsp;</div>
<div>The approach you&#39;re proposing might work. I need to take a look at your latest interface (I last tried on 1.1.3). Maybe I&#39;ll try again some day, just subsetting the decoder and wrapping it into an API that does not expose the complex data structure. It&nbsp;will probably boost my performance...
<br>&nbsp;</div>
<div>Pyt.<br>&nbsp;</div>
<div><span class="gmail_quote">On 6/14/07, <b class="gmail_sendername"><a href="mailto:xflac@yahoo.com">xflac@yahoo.com</a></b> &lt;<a href="mailto:xflac@yahoo.com">xflac@yahoo.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">is wrapping c++ any easier?&nbsp;&nbsp;because there is libFLAC++<br><br>otherwise, if you only need a certain subset of what FLAC does
<br>it might be easier to write a smaller C interface + wrapper<br>implementation, then import that in c#.<br><br>Josh<br><br>--- Pyt &lt;<a href="mailto:py.thoulon@gmail.com">py.thoulon@gmail.com</a>&gt; wrote:<br><br>&gt; I tried that approach a while ago and failed miserably. Marshalling
<br>&gt; the<br>&gt; structs of structs in the flac lib turned out to be a nightmare (I<br>&gt; don&#39;t<br>&gt; pretend to be an expert, mind you...).<br>&gt; I eventually switched to writing my own C# lib from scratch. Work is
<br>&gt; still<br>&gt; under progress. It&#39;s no rocket science, I do this a G-job. It has<br>&gt; definite<br>&gt; limitations (no documentation, decodes only 16-bit files, no encode,<br>&gt; *much*<br>&gt; slower than the flac reference implementation, but still reasonable
<br>&gt; for what<br>&gt; I do), but it can read and write metadata. It still needs a bit of<br>&gt; polishing<br>&gt; (esp. the documentation to be usable), but I&#39;d be willing to share it<br>&gt; at<br>&gt; some point. Note that it&#39;s not open source for the time being, but
<br>&gt; that<br>&gt; could be considered.<br>&gt;<br>&gt; Pyt.<br>&gt;<br>&gt; PS: If anybody has a real pinvoke wrapper for the reference lib, I&#39;d<br>&gt; gladly<br>&gt; take it... !<br>&gt;<br>&gt;<br>&gt; On 6/14/07, Jud White - 
<a href="mailto:jwhite@cdtag.com">jwhite@cdtag.com</a> &lt;+flac-<br>&gt; <a href="mailto:dev+pyt+af0255c9db.jwhite#cdtag.com@spamgourmet.com">dev+pyt+af0255c9db.jwhite#cdtag.com@spamgourmet.com</a>&gt; wrote:<br>&gt; &gt;
<br>&gt; &gt; Harry,<br>&gt; &gt;<br>&gt; &gt; DllImport is the way to go, but it&#39;s not always straightforward<br>&gt; what to<br>&gt; &gt; do (callbacks, pointers, and structs can get tricky).<br>&gt; &gt; <a href="http://pinvoke.net/">
http://pinvoke.net/</a> is a good resource for mapping Win32 API to C#<br>&gt; using<br>&gt; &gt; DllImport, you may find it useful for your efforts.&nbsp;&nbsp;I also found<br>&gt; this<br>&gt; &gt; article helpful in context of DllImport:
<br>&gt; &gt; <a href="http://www.vsj.co.uk/articles/display.asp?id=501">http://www.vsj.co.uk/articles/display.asp?id=501</a>.<br>&gt; &gt;<br>&gt; &gt; I have some C# code for working with FLAC and Vorbis Comments that<br>
&gt; does<br>&gt; &gt; not use the FLAC libraries:<br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br><a href="http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.Tagging/trunk/Tagging/VorbisComment/Classes/">http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.Tagging/trunk/Tagging/VorbisComment/Classes/
</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br><a href="http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.AudioInfo/trunk/Flac/">http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.AudioInfo/trunk/Flac/</a><br>&gt; &gt;
<br>&gt; &gt; taglib# also handles flac<br>&gt; &gt;<br>&gt; &gt; Erik de Castro Lopo wrote:<br>&gt; &gt; &gt; Harry Sack wrote:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&gt; but aren&#39;t they C++ headers en lib&#39;s?
<br>&gt; &gt; &gt;&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Not C++, C.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&gt; I have no idea how I can include a C++<br>&gt; &gt; &gt;&gt; header in a C# project.<br>&gt; &gt; &gt;&gt; It this even possible?
<br>&gt; &gt; &gt;&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Yes. Google for &quot;dllimport csharp&quot;.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Erik<br>&gt; &gt; &gt;<br>&gt; &gt; _______________________________________________
<br>&gt; &gt; Flac-dev mailing list<br>&gt; &gt; <a href="mailto:Flac-dev@xiph.org">Flac-dev@xiph.org</a><br>&gt; &gt; <a href="http://lists.xiph.org/mailman/listinfo/flac-dev">http://lists.xiph.org/mailman/listinfo/flac-dev
</a><br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; Flac-dev mailing list<br>&gt; <a href="mailto:Flac-dev@xiph.org">Flac-dev@xiph.org</a><br>&gt; <a href="http://lists.xiph.org/mailman/listinfo/flac-dev">
http://lists.xiph.org/mailman/listinfo/flac-dev</a><br>&gt;<br><br><br><br><br>____________________________________________________________________________________<br>Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
<br><a href="http://new.toolbar.yahoo.com/toolbar/features/norton/index.php">http://new.toolbar.yahoo.com/toolbar/features/norton/index.php</a><br></blockquote></div><br>