<div>I tried that approach a while ago and failed miserably. Marshalling the structs of structs in the flac lib turned out to be a nightmare (I don't pretend to be an expert, mind you...).</div>
<div>I eventually switched to writing my own C# lib from scratch. Work is still under progress. It's no rocket science, I do this a G-job. It has definite limitations (no documentation, decodes only 16-bit files, no encode, *much* slower than the flac reference implementation, but still reasonable for what I do), but it can read and write metadata. It still needs a bit of polishing (esp. the documentation to be usable), but I'd be willing to share it at some point. Note that it's not open source for the time being, but that could be considered.
</div>
<div> </div>
<div>Pyt.</div>
<div> </div>
<div>PS: If anybody has a real pinvoke wrapper for the reference lib, I'd gladly take it... !<br><br> </div>
<div><span class="gmail_quote">On 6/14/07, <b class="gmail_sendername">Jud White - <a href="mailto:jwhite@cdtag.com">jwhite@cdtag.com</a></b> <+flac-<a href="mailto:dev+pyt+af0255c9db.jwhite#cdtag.com@spamgourmet.com">
dev+pyt+af0255c9db.jwhite#cdtag.com@spamgourmet.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Harry,<br><br>DllImport is the way to go, but it's not always straightforward what to<br>do (callbacks, pointers, and structs can get tricky).
<br><a href="http://pinvoke.net/">http://pinvoke.net/</a> is a good resource for mapping Win32 API to C# using<br>DllImport, you may find it useful for your efforts. I also found this<br>article helpful in context of DllImport:
<br><a href="http://www.vsj.co.uk/articles/display.asp?id=501">http://www.vsj.co.uk/articles/display.asp?id=501</a>.<br><br>I have some C# code for working with FLAC and Vorbis Comments that does<br>not use the FLAC libraries:
<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><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><br>taglib# also handles flac<br><br>Erik de Castro Lopo wrote:
<br>> Harry Sack wrote:<br>><br>><br>>> but aren't they C++ headers en lib's?<br>>><br>><br>> Not C++, C.<br>><br>><br>>> I have no idea how I can include a C++<br>>> header in a C# project.
<br>>> It this even possible?<br>>><br>><br>> Yes. Google for "dllimport csharp".<br>><br>> Erik<br>><br>_______________________________________________<br>Flac-dev mailing list<br><a href="mailto:Flac-dev@xiph.org">
Flac-dev@xiph.org</a><br><a href="http://lists.xiph.org/mailman/listinfo/flac-dev">http://lists.xiph.org/mailman/listinfo/flac-dev</a><br></blockquote></div><br>