Lame wird nur als C-Quellcode veröffentlicht und ich habe eigentlich keine Ahnung davon. Hinzu kommt, dass ich bisher noch nie mit Dlls gearbeitet habe.

Hier mein aktueller Fortschritt:
Code: Alles auswählen
;- Constants
;{
;{ Encoding formats
#BE_CONFIG_MP3 = 0
#BE_CONFIG_LAME = 256
;}
;{ Error codes
#BE_ERR_SUCCESSFUL = $00000000
#BE_ERR_INVALID_FORMAT = $00000001
#BE_ERR_INVALID_FORMAT_PARAMETERS = $00000002
#BE_ERR_NO_MORE_HANDLES = $00000003
#BE_ERR_INVALID_HANDLE = $00000004
#BE_ERR_BUFFER_TOO_SMALL = $00000005
;}
;{ Other constants
#BE_MAX_HOMEPAGE = 128
;}
;{ Format specific variables
#BE_MP3_MODE_STEREO = 0
#BE_MP3_MODE_JSTEREO = 1
#BE_MP3_MODE_DUALCHANNEL = 2
#BE_MP3_MODE_MONO = 3
;}
#MPEG1 = 1
#MPEG2 = 0
#CURRENT_STRUCT_VERSION = 1
#CURRENT_STRUCT_SIZE = 331 ;SizeOf(BE_CONFIG) ; Is currently 331 bytes
; VBRMETHOD
#VBR_METHOD_NONE = -1
#VBR_METHOD_DEFAULT = 0
#VBR_METHOD_OLD = 1
#VBR_METHOD_NEW = 2
#VBR_METHOD_MTRH = 3
#VBR_METHOD_ABR = 4
; LAME QUALITY PRESET
#LQP_NOPRESET = -1
#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
#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
;}
;- Structures
;{
Structure BE_CONFIG
dwConfig.l
StructureUnion
Structure mp3
dwSampleRate.l
byMode.b
wBitrate.w
BOOL bPrivate
BOOL bCRC
BOOL bCopyright
BOOL bOriginal
EndStructure
Structure LHV1
; Structure INFORMATION
dwStructVersion.l
dwStructSize.l
; BASIC ENCODER SETTINGS
dwSampleRate.l
dwReSampleRate.l
nMode.l
dwBitrate.l
dwMaxBitrate.l
nPreset.l
dwMpegVersion.l
dwPsyModel.l
dwEmphasis.l
; BIT STREAM SETTINGS
BOOL bPrivate
BOOL bCRC
BOOL bCopyright
BOOL bOriginal
; VBR STUFF
BOOL bWriteVBRHeader
BOOL bEnableVBR
nVBRQuality.l
dwVbrAbr_bps.l
VBRMETHOD nVbrMethod
BOOL bNoRes
; MISC SETTINGS
BOOL bStrictIso
nQuality.w
; FUTURE USE, SET To 0, align strucutre To 331 bytes
btReserved.b{255 - 4 * SizeOf(Long) - SizeOf(Word)}
EndStructure
Structure aac
dwSampleRate.l
byMode.b
wBitrate.w
byEncodingMethod.b
EndStructure
EndStructureUnion
EndStructure
Structure BE_VERSION
; BladeEnc DLL Version number
byDLLMajorVersion.b
byDLLMinorVersion.b
; BladeEnc Engine Version Number
byMajorVersion.b
byMinorVersion.b
; DLL Release date
byDay.b
byMonth.b
wYear.w
; BladeEnc Homepage URL
zHomepage.a{#BE_MAX_HOMEPAGE + 1}
byAlphaLevel.b
byBetaLevel.b
byMMXEnabled.b
btReserved.b{125}
EndStructure
;}
Prototype beInitStream(*pbeConfig.BE_CONFIG, *dwSamples.l, *dwBufferSize.l, *phbeStream.BE_STREAM)
Prototype beEncodeChunk(hbeStream.BE_STREAM, nSamples.l, *pSamples.w, *pOutput.b, *pdwOutput.l)
; Added for floating point audio -- DSPguru, jd
Prototype beEncodeChunkFloatS16NI(hbeStream.BE_STREAM, nSamples.l, *buffer_l.f, *buffer_r.f, *pOutput.b, *pdwOutput.w)
Prototype beDeinitStream(hbeStream.BE_STREAM, *pOutput.b, *pdwOutput.l)
Prototype beCloseStream(hbeStream.BE_STREAM)
Prototype beVersion(*pbeVersion.BE_VERSION)
Prototype beWriteVBRHeader(lpszFileName.s)
Prototype beFlushNoGap(hbeStream.BE_STREAM, *pOutput.b, *pdwOutput.l)
Prototype beWriteInfoTag(hbeStream.BE_STREAM, lpszFileName.s)
LibraryNr = OpenLibrary(#PB_Any, "lame_enc.dll")
If LibraryNr
; [...]
Definitionsdatei: http://lame.cvs.sourceforge.net/viewvc/ ... iew=markup
Readme über Benutzung der Dll: http://lame.cvs.sourceforge.net/viewvc/ ... erface.htm
Meine eigentlichen Fragen sind nun: Wie kann ich BOOL umsetzen? Wie werden die Funktionen richtig definiert? Was hat es mit dieser StructureUnion auf sich? (Habe ich den bisherigen Code richtig übersetzt?)