[Flac-dev] FLAC: library for C#

Pyt
Thu, 14 Jun 2007 12:39:47 -0000

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...).
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.

Pyt.

PS: If anybody has a real pinvoke wrapper for the reference lib, I'd gladly
take it... !


On 6/14/07, Jud White - jwhite@cdtag.com <+flac-
dev+pyt+af0255c9db.jwhite#cdtag.com@spamgourmet.com>
wrote:
>
> Harry,
>
> DllImport is the way to go, but it's not always straightforward what to
> do (callbacks, pointers, and structs can get tricky).
> http://pinvoke.net/ is a good resource for mapping Win32 API to C# using
> DllImport, you may find it useful for your efforts.  I also found this
> article helpful in context of DllImport:
> http://www.vsj.co.uk/articles/display.asp?id=501.
>
> I have some C# code for working with FLAC and Vorbis Comments that does
> not use the FLAC libraries:
>
>
http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.Tagging/trunk/Tagging/VorbisComment/Classes/
>
>
http://idsharp.svn.sourceforge.net/viewvc/idsharp/IdSharp.AudioInfo/trunk/Flac/
>
> taglib# also handles flac
>
> Erik de Castro Lopo wrote:
> > Harry Sack wrote:
> >
> >
> >> but aren't they C++ headers en lib's?
> >>
> >
> > Not C++, C.
> >
> >
> >> I have no idea how I can include a C++
> >> header in a C# project.
> >> It this even possible?
> >>
> >
> > Yes. Google for "dllimport csharp".
> >
> > Erik
> >
> _______________________________________________
> Flac-dev mailing list
> Flac-dev@xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...