How to use LAME (lame_enc.dll) on my C # website

I am trying to use lame_enc.dll in my C # .NET website and I am stuck.

I work with: .NET Framework 3.5 / Visual Web Developer 2008 Express Edition / (Anything else you need to know?)

The first thing I did was get the C # MP3 Compressor code in the Code project. One thing I noticed is that this project / post has been since January 2004 (so, it's old)

I put the "yeti.mmedia" and "yeti.mp3" folders in my "App_Code" directory and deleted the "Bin" and "obj" directories inside each. Then I tried to build a project. When I received the errors, I eventually excluded the following files from the project:

  • yeti.mmedia / AssemblyInfo.cs
  • yeti.mmedia / EditWaveWriter.cs
  • yeti.mmedia / EditWaveWriter.resx
  • yeti.mmedia / InFormatEdit.cs
  • yeti.mmedia / InFormatEdit.resx
  • yeti.mmedia / NumericTextBox.cs
  • yeti.mmedia / NumericTextBox.resx
  • yeti.mmedia / Win32Functions.cs
  • yeti.mp3 / AssemblyInfo.cs
  • yeti.mp3 / EditMp3Writer.cs
  • yeti.mp3 / EditMp3Writer.resx

It seems to me that these are code files related to the Windows user interface (which I do not need, I do it on the Internet).

I also put the file "lame_enc.dll" in the Bin directory.

I created a test page using the example above:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using WaveLib;
using Yeti.MMedia;
using Yeti.MMedia.Mp3;

public partial class Documents : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        WaveStream InStr = new WaveStream(Server.MapPath(@"Temp/SomeFile.wav"));
        try {
            Mp3Writer writer = new Mp3Writer(new FileStream(Server.MapPath(@"Temp/SomeFile.mp3"), FileMode.Create), InStr.Format);
            try {
                byte[] buff = new byte[writer.OptimalBufferSize];
                int read = 0;
                while ((read = InStr.Read(buff, 0, buff.Length)) > 0) {
                    writer.Write(buff, 0, read);
                }
            }
            finally {
                writer.Close();
            }
        }
        finally {
            InStr.Close();
        }
    }
}

So, I load this page and get an error:

Unable to load DLL 'Lame_enc.dll': the specified module was not found. (Exception from HRESULT: 0x8007007E)

( DLL , : "... COM-".) (lame3.98.4) dll . , , - -, . , .

+5
1

, LAME, . . , Lame_Enc.dll - , PInvoke.

+1

All Articles