Hi All,
I want to make single file encoder with lame_enc.dll.
I have DLL Manual and it tells me steps to follow is to fill BE_CONFIG and going with other stuffs. I'm newbee with this and I need help to get started.
Google didn't help me much, I tried in other places with no avail. I hope someone here will give me a shoulder of help to get started with this library.
Thanks for your precious time
16 3989
I could help if you were using Windows.
JosAH 11,448
Recognized Expert MVP @weaknessforcats
".dll" is a windowism; us regular folks who might wear tennis shoes or an occasional python boot call it a ".so" object ;-)
kind regards,
Jos
So what do they call a DLL in Unix-land?
JosAH 11,448
Recognized Expert MVP @weaknessforcats
As I wrote above: a "shared object" (.so)
kind regards,
Jos
Banfa 9,065
Recognized Expert Moderator Expert
Apostle it is not at all clear, are you trying to write a DLL or use a DLL? I assume you are using Windows?
Do you have a copy of Windows via C/C++ by Jeffrey Richter?
How to use a DLL is covered in excruciating detail there.
The only thing you need know at the outset is whether you want to use implicit or explicit linking. That is, do you call the DLL methods directly as you would other functions and let the compiler generate code to locate the DLL, load it, locate the funciton in the DLL and call that function each time you make a call (implicit linking) or whether you will load the DLL yourself and use GetProcAddress to locate the address of the functions in the DLL which you will keep around as function pointers to use in function calls later (explicit linking).
I plan to use implicit, yet I cannot find the .lib file in lame distribution.
BTW I don't have that book!
You need that book.
However, if there is no .lib file distributed with the DLL then look at the .h file that is distributed. Do you see anything like __declspec(dllimport) in the function prototypes?
If not, you cannot use implicit linking but now have to do the linking yourself explicitly at run time using LoadLibrary, GetProcAddress and a bunch of function pointers.
If the __declspec(dllimport) is there then there must be a .lib file that contains the code necessary to call the function. This is a load of the dll (if necessary) an address lookup of the function in the dll and a call to that function using that address.
Please note: The DLLs export functions do not work in C++ due to name mangling. Be sure your code is all extern"C" when referring to DLL functions. Internal DLL functions can use C++ but the interfacing functions cannot.
I really wish to but here in my country such technological books are hard to have.
They are, infact difficult to get. So unless there is free PDF, I cannot have it!
Very sad to say :(
I want to get started with THIS lame_enc.dll
I have read the MSDN and have an overview. What I miss is how to Jump start!
Post a piece of the .h file that you have for the DLL.
-
/*
-
* Blade Type of DLL Interface for Lame encoder
-
*
-
* Copyright (c) 1999-2002 A.L. Faber
-
* Based on bladedll.h version 1.0 written by Jukka Poikolainen
-
*
-
* This library is free software; you can redistribute it and/or
-
* modify it under the terms of the GNU Lesser General Public
-
* License as published by the Free Software Foundation; either
-
* version 2 of the License, or (at your option) any later version.
-
*
-
* This library is distributed in the hope that it will be useful,
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-
* Lesser General Public License for more details.
-
*
-
* You should have received a copy of the GNU Lesser General Public
-
* License along with this library; if not, write to the
-
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-
* Boston, MA 02111-1307, USA.
-
*/
-
-
#ifndef ___BLADEDLL_H_INCLUDED___
-
#define ___BLADEDLL_H_INCLUDED___
-
-
#ifdef __GNUC__
-
#define ATTRIBUTE_PACKED __attribute__((packed))
-
#else
-
#define ATTRIBUTE_PACKED
-
#pragma pack(push)
-
#pragma pack(1)
-
#endif
-
-
#ifdef __cplusplus
-
extern "C" {
-
#endif
-
-
/* encoding formats */
-
-
#define BE_CONFIG_MP3 0
-
#define BE_CONFIG_LAME 256
-
-
/* type definitions */
-
-
typedef unsigned long HBE_STREAM;
-
typedef HBE_STREAM *PHBE_STREAM;
-
typedef unsigned long BE_ERR;
-
-
/* error codes */
-
-
#define BE_ERR_SUCCESSFUL 0x00000000
-
#define BE_ERR_INVALID_FORMAT 0x00000001
-
#define BE_ERR_INVALID_FORMAT_PARAMETERS 0x00000002
-
#define BE_ERR_NO_MORE_HANDLES 0x00000003
-
#define BE_ERR_INVALID_HANDLE 0x00000004
-
#define BE_ERR_BUFFER_TOO_SMALL 0x00000005
-
-
/* other constants */
-
-
#define BE_MAX_HOMEPAGE 128
-
-
/* format specific variables */
-
-
#define BE_MP3_MODE_STEREO 0
-
#define BE_MP3_MODE_JSTEREO 1
-
#define BE_MP3_MODE_DUALCHANNEL 2
-
#define BE_MP3_MODE_MONO 3
-
-
-
-
#define MPEG1 1
-
#define MPEG2 0
-
-
#ifdef _BLADEDLL
-
#undef FLOAT
-
#include <Windows.h>
-
#endif
-
-
#define CURRENT_STRUCT_VERSION 1
-
#define CURRENT_STRUCT_SIZE sizeof(BE_CONFIG) // is currently 331 bytes
-
-
-
typedef enum
-
{
-
VBR_METHOD_NONE = -1,
-
VBR_METHOD_DEFAULT = 0,
-
VBR_METHOD_OLD = 1,
-
VBR_METHOD_NEW = 2,
-
VBR_METHOD_MTRH = 3,
-
VBR_METHOD_ABR = 4
-
} VBRMETHOD;
-
-
typedef enum
-
{
-
LQP_NOPRESET =-1,
-
-
// QUALITY PRESETS
-
LQP_NORMAL_QUALITY = 0,
-
LQP_LOW_QUALITY = 1,
-
LQP_HIGH_QUALITY = 2,
-
LQP_VOICE_QUALITY = 3,
-
LQP_R3MIX = 4,
-
LQP_VERYHIGH_QUALITY = 5,
-
LQP_STANDARD = 6,
-
LQP_FAST_STANDARD = 7,
-
LQP_EXTREME = 8,
-
LQP_FAST_EXTREME = 9,
-
LQP_INSANE = 10,
-
LQP_ABR = 11,
-
LQP_CBR = 12,
-
LQP_MEDIUM = 13,
-
LQP_FAST_MEDIUM = 14,
-
-
// NEW PRESET VALUES
-
LQP_PHONE =1000,
-
LQP_SW =2000,
-
LQP_AM =3000,
-
LQP_FM =4000,
-
LQP_VOICE =5000,
-
LQP_RADIO =6000,
-
LQP_TAPE =7000,
-
LQP_HIFI =8000,
-
LQP_CD =9000,
-
LQP_STUDIO =10000
-
-
} LAME_QUALITY_PRESET;
-
-
-
-
typedef struct {
-
DWORD dwConfig; // BE_CONFIG_XXXXX
-
// Currently only BE_CONFIG_MP3 is supported
-
union {
-
-
struct {
-
-
DWORD dwSampleRate; // 48000, 44100 and 32000 allowed
-
BYTE byMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
-
WORD wBitrate; // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed
-
BOOL bPrivate;
-
BOOL bCRC;
-
BOOL bCopyright;
-
BOOL bOriginal;
-
-
} mp3; // BE_CONFIG_MP3
-
-
struct
-
{
-
// STRUCTURE INFORMATION
-
DWORD dwStructVersion;
-
DWORD dwStructSize;
-
-
// BASIC ENCODER SETTINGS
-
DWORD dwSampleRate; // SAMPLERATE OF INPUT FILE
-
DWORD dwReSampleRate; // DOWNSAMPLERATE, 0=ENCODER DECIDES
-
LONG nMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
-
DWORD dwBitrate; // CBR bitrate, VBR min bitrate
-
DWORD dwMaxBitrate; // CBR ignored, VBR Max bitrate
-
LONG nPreset; // Quality preset, use one of the settings of the LAME_QUALITY_PRESET enum
-
DWORD dwMpegVersion; // FUTURE USE, MPEG-1 OR MPEG-2
-
DWORD dwPsyModel; // FUTURE USE, SET TO 0
-
DWORD dwEmphasis; // FUTURE USE, SET TO 0
-
-
// BIT STREAM SETTINGS
-
BOOL bPrivate; // Set Private Bit (TRUE/FALSE)
-
BOOL bCRC; // Insert CRC (TRUE/FALSE)
-
BOOL bCopyright; // Set Copyright Bit (TRUE/FALSE)
-
BOOL bOriginal; // Set Original Bit (TRUE/FALSE)
-
-
// VBR STUFF
-
BOOL bWriteVBRHeader; // WRITE XING VBR HEADER (TRUE/FALSE)
-
BOOL bEnableVBR; // USE VBR ENCODING (TRUE/FALSE)
-
INT nVBRQuality; // VBR QUALITY 0..9
-
DWORD dwVbrAbr_bps; // Use ABR in stead of nVBRQuality
-
VBRMETHOD nVbrMethod;
-
BOOL bNoRes; // Disable Bit resorvoir (TRUE/FALSE)
-
-
// MISC SETTINGS
-
BOOL bStrictIso; // Use strict ISO encoding rules (TRUE/FALSE)
-
WORD nQuality; // Quality Setting, HIGH BYTE should be NOT LOW byte, otherwhise quality=5
-
-
// FUTURE USE, SET TO 0, align strucutre to 331 bytes
-
BYTE btReserved[255-4*sizeof(DWORD) - sizeof( WORD )];
-
-
} LHV1; // LAME header version 1
-
-
struct {
-
-
DWORD dwSampleRate;
-
BYTE byMode;
-
WORD wBitrate;
-
BYTE byEncodingMethod;
-
-
} aac;
-
-
} format;
-
-
} BE_CONFIG, *PBE_CONFIG ATTRIBUTE_PACKED;
-
-
-
typedef struct {
-
-
// BladeEnc DLL Version number
-
-
BYTE byDLLMajorVersion;
-
BYTE byDLLMinorVersion;
-
-
// BladeEnc Engine Version Number
-
-
BYTE byMajorVersion;
-
BYTE byMinorVersion;
-
-
// DLL Release date
-
-
BYTE byDay;
-
BYTE byMonth;
-
WORD wYear;
-
-
// BladeEnc Homepage URL
-
-
CHAR zHomepage[BE_MAX_HOMEPAGE + 1];
-
-
BYTE byAlphaLevel;
-
BYTE byBetaLevel;
-
BYTE byMMXEnabled;
-
-
BYTE btReserved[125];
-
-
-
} BE_VERSION, *PBE_VERSION ATTRIBUTE_PACKED;
-
-
#ifndef _BLADEDLL
-
-
typedef BE_ERR (*BEINITSTREAM) (PBE_CONFIG, PDWORD, PDWORD, PHBE_STREAM);
-
typedef BE_ERR (*BEENCODECHUNK) (HBE_STREAM, DWORD, PSHORT, PBYTE, PDWORD);
-
-
// added for floating point audio -- DSPguru, jd
-
typedef BE_ERR (*BEENCODECHUNKFLOATS16NI) (HBE_STREAM, DWORD, PFLOAT, PFLOAT, PBYTE, PDWORD);
-
typedef BE_ERR (*BEDEINITSTREAM) (HBE_STREAM, PBYTE, PDWORD);
-
typedef BE_ERR (*BECLOSESTREAM) (HBE_STREAM);
-
typedef VOID (*BEVERSION) (PBE_VERSION);
-
typedef BE_ERR (*BEWRITEVBRHEADER) (LPCSTR);
-
typedef BE_ERR (*BEWRITEINFOTAG) (HBE_STREAM, LPCSTR );
-
-
#define TEXT_BEINITSTREAM "beInitStream"
-
#define TEXT_BEENCODECHUNK "beEncodeChunk"
-
#define TEXT_BEENCODECHUNKFLOATS16NI "beEncodeChunkFloatS16NI"
-
#define TEXT_BEDEINITSTREAM "beDeinitStream"
-
#define TEXT_BECLOSESTREAM "beCloseStream"
-
#define TEXT_BEVERSION "beVersion"
-
#define TEXT_BEWRITEVBRHEADER "beWriteVBRHeader"
-
#define TEXT_BEFLUSHNOGAP "beFlushNoGap"
-
#define TEXT_BEWRITEINFOTAG "beWriteInfoTag"
-
-
-
#else
-
-
__declspec(dllexport) BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
-
__declspec(dllexport) BE_ERR beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
-
-
// added for floating point audio -- DSPguru, jd
-
__declspec(dllexport) BE_ERR beEncodeChunkFloatS16NI(HBE_STREAM hbeStream, DWORD nSamples, PFLOAT buffer_l, PFLOAT buffer_r, PBYTE pOutput, PDWORD pdwOutput);
-
__declspec(dllexport) BE_ERR beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
-
__declspec(dllexport) BE_ERR beCloseStream(HBE_STREAM hbeStream);
-
__declspec(dllexport) VOID beVersion(PBE_VERSION pbeVersion);
-
__declspec(dllexport) BE_ERR beWriteVBRHeader(LPCSTR lpszFileName);
-
__declspec(dllexport) BE_ERR beFlushNoGap(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
-
__declspec(dllexport) BE_ERR beWriteInfoTag( HBE_STREAM hbeStream, LPCSTR lpszFileName );
-
-
#endif
-
-
#ifdef __cplusplus
-
}
-
#endif
-
-
#ifndef __GNUC__
-
#pragma pack(pop)
-
#endif
-
-
#endif
-
-
After several trials, I decided to give up!
I have never been succcessful in setup any meaningful C++ projects a part from foolish learning garbages. May be another time I will give it a try again
Very sad!!
The header file looks like you will need to use LoadLibrary and GetProcAddress to do the linking yourself. Google has lots of examples on how to do this.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: **ham |
last post by:
"Visual Studio .NET has detected that the specified Web server is not
running ASP.NET version 1.1. You will be unable to run ASP.NET Web
applications or services."
This is the message I get each...
|
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
...
|
by: |
last post by:
Hi All,
I have allready tried to ask a similar question , but got no answer until now. In the meantime, I
found, that I cannot understand some thread-settings for the Main() function
.
If I use...
|
by: Siegfried Heintze |
last post by:
I refered the engineer at my hosting service to
http://support.microsoft.com/default.aspx?scid=kb;en-us;825738 where he
tried to follow the directions there.
He said there was no such file:...
|
by: stuart_white_ |
last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the
new version of Python seems to be running correctly, I can't seem
access the help from the interpreter.
On Python 2.3.3...
| |
by: sgMuser |
last post by:
Hi,
I am not a good developer of Javascript codes. Needs this help to make
some modification to this famous free javascript from Anarchos. i am
using this in one of my webpage. What it does is,...
|
by: Jack Wu |
last post by:
Hi
I've spent a good majority of my day trying to figure out how to have
PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I
have not gotten anywhere. Could somebody please...
|
by: Jay |
last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send
text messages to many, many employees via system.timer at a 5 second
interval. Basically, I look in a SQL table (queue) to...
|
by: HelpME |
last post by:
I wrote a program in Vb.Net that was running fine. However I am
unable to install it on a couple of machines. When i run it I get a
windows error message that says
My Project.exe has...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |