Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: Change password in System.Data.Sqlite Pin
amrok2amrokk29-May-12 4:46
amrok2amrokk29-May-12 4:46 
GeneralRe: Change password in System.Data.Sqlite Pin
amrok2amrokk29-May-12 7:04
amrok2amrokk29-May-12 7:04 
QuestionNot all code paths return a value Pin
sheringkapoting29-May-12 0:40
sheringkapoting29-May-12 0:40 
AnswerRe: Not all code paths return a value Pin
Can SARIGÜL29-May-12 0:43
Can SARIGÜL29-May-12 0:43 
GeneralRe: Not all code paths return a value Pin
sheringkapoting29-May-12 0:51
sheringkapoting29-May-12 0:51 
AnswerRe: Not all code paths return a value Pin
Pete O'Hanlon29-May-12 0:51
mvePete O'Hanlon29-May-12 0:51 
AnswerRe: Not all code paths return a value Pin
Apocalypse Now30-May-12 14:12
Apocalypse Now30-May-12 14:12 
GeneralUsing lame_enc.dll in .NET - Signature mismatch Pin
ChrisHinde28-May-12 15:11
ChrisHinde28-May-12 15:11 
I'm working on a program that will convert a wav-file to mp3, tag it and then upload it via FTP.

I'm done with the FTP-part and am now working on the converting to MP3 part (the only thing left).
The plan is to use LAME (lame_enc.dll) to do the encoding/converting (unless you have any other suggestion). But I've hit a snag.

I couldn't find any good examples for Lame & .NET. I found this here on TCP: C# MP3 Compressor[^]
It wouldn't compile due to missing form components, but I copied the the classes that's relevant.

The project compiles but I get an exception on the call to beInitStream (in the constructor of Mp3Writer). The error states:
PInvokeStackImbalance was detected

and that "the managed PInvoke signature didn't match the unmanaged target signature" (translated from Swedish).

Is there anyone that has an idea what's wrong?! Is this code written for an older version of lame_enc.dll (I've looked at the documentation, but can't see the problem)?

I also tried to use IntPtr etc (found in another example for another DLL), but same result:
C#
Marshal.StructureToPtr(Marshal.SizeOf(m_Mp3Config), Marshal.AllocHGlobal(pConfig), false);

uint LameResult = Lame_encDll.beInitStream(ref pConfig, ref m_InputSamples, ref m_OutBufferSize, ref m_hLameStream);


Code for DLL import:

C#
[DllImport("Lame_enc.dll")]
public static extern uint beInitStream(ref BE_CONFIG pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);

or
C#
[DllImport("Lame_enc.dll")]
public static extern uint beInitStream(ref IntPtr pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);


I could just call lame.exe, but I don't want to do it, mainly because I want to report the progress.

Glad for any help/ideas!
AnswerRe: Using lame_enc.dll in .NET - Signature mismatch Pin
Luc Pattyn28-May-12 15:24
sitebuilderLuc Pattyn28-May-12 15:24 
GeneralRe: Using lame_enc.dll in .NET - Signature mismatch Pin
BobJanova28-May-12 23:26
BobJanova28-May-12 23:26 
GeneralRe: Using lame_enc.dll in .NET - Signature mismatch Pin
DaveyM6929-May-12 1:40
professionalDaveyM6929-May-12 1:40 
Questionobject reference not set to an instance of an object Pin
a.fatemeh28-May-12 12:16
a.fatemeh28-May-12 12:16 
AnswerRe: object reference not set to an instance of an object Pin
Manfred Rudolf Bihy28-May-12 12:36
professionalManfred Rudolf Bihy28-May-12 12:36 
GeneralRe: object reference not set to an instance of an object Pin
a.fatemeh28-May-12 12:52
a.fatemeh28-May-12 12:52 
GeneralRe: object reference not set to an instance of an object Pin
Manfred Rudolf Bihy29-May-12 1:34
professionalManfred Rudolf Bihy29-May-12 1:34 
AnswerRe: object reference not set to an instance of an object Pin
bishu_Visu28-May-12 18:24
bishu_Visu28-May-12 18:24 
Questiondatabase on wp7 Pin
heba abu ghaleih22 28-May-12 0:42
heba abu ghaleih22 28-May-12 0:42 
AnswerRe: database on wp7 Pin
Pete O'Hanlon28-May-12 1:51
mvePete O'Hanlon28-May-12 1:51 
AnswerRe: database on wp7 Pin
jschell28-May-12 7:41
jschell28-May-12 7:41 
GeneralRe: database on wp7 Pin
heba abu ghaleih22 28-May-12 8:12
heba abu ghaleih22 28-May-12 8:12 
GeneralRe: database on wp7 Pin
jschell30-May-12 13:40
jschell30-May-12 13:40 
QuestionPDF Editing Pin
candogu27-May-12 21:44
candogu27-May-12 21:44 
AnswerRe: PDF Editing Pin
AmitGajjar27-May-12 22:00
professionalAmitGajjar27-May-12 22:00 
AnswerRe: PDF Editing Pin
CodingLover28-May-12 17:57
CodingLover28-May-12 17:57 
Questionfrom array byte to bitmap Pin
heba abu ghaleih22 26-May-12 18:30
heba abu ghaleih22 26-May-12 18:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.