English
Forum

FLOAT as Return Value from the AudioGenie.DLL

 
- Page 1 -



Georg
Hovenbitzer
Hello together,

I have the following trouble:
The function AUDIOGetDuration supply as Return Value a FLOAT worth.
Diesen I get simply not gefasst, by me becomes usually The Biterate displayed.
The Programmer the DLL Stefan Töngi was so kind and has a couple Test implemented and wrote then.



Hi,

have now again in the Debug-fashion your Beispielprojekt run and the DLL-functions go correctly called.
too The Rückgabewerte to profane are correctly. apparently must You yet explizit The Rückgabewerte indicate,
because with whom others korrekten Call go everywhere LONG-variables uses, only the Duration becomes one FLOAT zurückgegeben. Perhaps becomes there intern what wrong interprets.
look time in the Profan Forum to DLL and FLOAT, there find You certainly something suitable...


Perhaps can your me help. (i'm me there really very sure )

alas Yes, The DLL get your under www.audiogenie.de
CompileMarkSeparation
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
06/24/08  
 



 
- Page 1 -



Dieter
Zornow
I have time your code ausprobiert and a little experimentiert, I then as Stefan Töngi The first Version, hieß then yet MP3Reader.dll herausbrachte , plenty so made have.

the Result was but always the same, I got too always The Biterate displayed, have the with MP3 ´s with differently Biteraten ausprobiert. i think here's either with Profane or in the Dll something rotten.
its but already strange, that always exakt The Biterate zurückkommt. i think, that The Dll already at analyse any erkannte values in memory hinterlegt and Perhaps the value from the incorrect area zurückgibt. Dürfte but not so his, there itself then already certainly many User gemeldet hätten.

Related to the Float-area can you you probably save. an simple Float-Variable supply whom equal worth.

greeting

Dieter
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
06/24/08  
 



can time one Screenshot of
CompileMarkSeparationmake?
 
06/24/08  
 




RGH
Hello!

gives The DLL a 64- or a 32-bit-Fließkommawert back?

If it one 64-bit-Fließkommawert is, becomes it with XProfan not weg. is it one 32-bit-worth, what wahrscheinlicher is, can You it first of all in a Longint Save (= 32 bit) and then with the function @Float() in a Fließkommawert XProfanscher Prägung (double = 64 bit) transfiguring.

The Idea with the Memory-Variables would then functions, unless the worth self, separate which address (Zeiger) zurückgegeben would. One take action, the of course too often found is, but presumably not this drop.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/24/08  
 




Georg
Hovenbitzer
Hello zusammnen,

many Thanks for Test and hints.

@If
The Screenshot depends on, it come thrice The equal values out.

@Roland
I hope, I have your completions correctly. umgesetzt.
Hierbei comes it always to a Schutzverletzung at attempt the conversion in a Fließkommawert.
I have at developer the DLL time angefragt whether a 64bit or 32bit worth back given becomes.
CompileMarkSeparation
Def AUDIOAnalyzeFile(1) !AudioGenie2.dll,AUDIOAnalyzeFile
Def AUDIOGetDuration(0) !AudioGenie2.dll,AUDIOGetDuration
Def MultiByteToWideChar(6) !KERNEL32.DLL,MultiByteToWideChar

Proc ToWide

    Parameters Original$
    Var L& = @Len(Original$)
    Var Ziel$ = @Space$((L& * 2))
    MultiByteToWideChar($0,$1,@Addr(Original$),L&,@Addr(Ziel$),(L& * 2))
    Return Ziel$

EndProc

Proc _AUDIOAnalyzeFile

    Parameters Pfad$
    Pfad$ = ToWide(Pfad$)
    Return AUDIOAnalyzeFile(@Addr(Pfad$))

EndProc

Proc _AUDIOGetDuration

    Declare Ret#
    Dim Ret#,8
    Float Ret#,0 = AUDIOGetDuration()
    Var Ret! = @Float(Ret#,0)
    Dispose Ret#
    Return Ret!

EndProc

Proc _Roland

    Var Ret& = AUDIOGetDuration()
    Var Ret! = @Float(Ret&,0)
    Return Ret!

EndProc

Declare ID3DLL&, Ende&, File$
Window 100,100-800,600
ID3DLL& = @UseDLL(AudioGenie2.dll)

WhileNot Ende& = 1

    WaitInput

    If %Key = 13

        File$ =
        File$ = @LoadFile$(ÖFFNE,*.mp3)
        Cls
        Print Gültige MP3 Datei = ,_AUDIOAnalyzeFile(File$)
        Print
        Print Duration = ,_AUDIOGetDuration()
        Print
        Print Lösungsvorschlag = ,_Roland()
        Print

    ElseIf %Key = 2

        Ende& = 1

    EndIf

EndWhile

FreeDLL ID3DL
class=s4 href='./../../Function-References/XProfan/end/'>End

22 kB
Kurzbeschreibung: Screenshot
Hochgeladen:06/26/08
Downloadcounter122
Download
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
06/26/08  
 



If AUDIOGetDuration() objectively three time in follow 192 outputs is at least clear, that behind this worth no Duration zurückgeliefert becomes, or position 0 with 192 bit meant is.
 
06/26/08  
 




Dieter
Zornow
I have time your code tested, by me comes quite nothing, crashes when calling same ex. I have me time whom Delphi-Wrapper loaded, thereafter is it in Delphi a Single - Variable 4 bytes big. I have but no idea How the in Profan umzusetzen is.
generally is the Dll what The One - and spending betrift very badly documents, therefore is the Wrapper useful one sees at least what expects becomes z.B. Unicode
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
06/26/08  
 




RGH
Georg Hovenbitzer
@Roland
I hope, I have your completions correctly. umgesetzt.


Ähem ... Yes and No ... dfenn I have you The incorrect function called. not @Float(), separate @double() was meant. the strength a 32-bit-Fließkommazahl (stored in the Integer) a 64-bit-Fließkommazahl. try means time
CompileMarkSeparation
<...>
Var Ret& = AUDIOGetDuration()
Var Ret! = @Double(Ret&)
<...&
pre>

Greeting
Roland

(Since I The DLL momentarily not here have, can I not immediate testing.)
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/26/08  
 




RGH
Nachtrag:

I have now The DLL by me installs. according the on the Homepage the DLL vorhandenen ausführlichen german Documentation ( [...]  ) should my Solution functions. does tappt im dunkeln but not. is it possible, that not any MP3 The information over The length in the form include, The The DLL auswertet?
for wahrscheinlicher stops I but a Error in the DLL, there definitiv always The Bitrate outputted becomes. here my small Testprogramm:
CompileMarkSeparation
Proc Str2WideChar

    Wandelt den Ansi-String Ansi$ in einen WideChar-String um
    Parameters Ansi$
    Declare Wide$

    WhileLoop 1, Len(Ansi$)

        Wide$ = Wide$ + Substr$(Ansi$, &loop) + z

    EndWhile

    Return Wide$

EndProc

Proc WideCharAddr2Str

    Ermittelt aus der Adresse eines WideChar-Strings buf&
    den entsprechenden Ansi-String
    Parameters buf&
    Declare I%, Ansi$, WChar$
    I% = 0
    WChar$ = Char$(buf&, I%, 2)

    While WChar$ <> zz

        Ansi$ = Ansi$ + Char$(buf&, I%, 1)
        Inc I%, 2
        WChar$ = Char$(buf&, I%, 2)

    EndWhile

    Return Ansi$

EndProc

Declare File$
Declare Dll&
Declare Tmp&
Cls
File$ = Str2WideChar(Test.mp3)
Dll& = @ImportDLL(AudioGenie2.dll, My_)
Print Handle DLL = ,Dll&
Tmp& = My_GetAudioGenieVersion()
Print Version =  + WideCharAddr2Str(Tmp&)
Tmp& = My_AUDIOAnalyzeFile(Addr(File$))
Print bei MP3 sollte 1 kommen = ,Tmp&
Tmp& = My_GetID3V1Album()
Print Album =  + WideCharAddr2Str(Tmp&)
Tmp& = My_GetID3V1Artist()
Print Artist =  + WideCharAddr2Str(Tmp&)
Tmp& = My_GetID3V1Title()
Print Title =  + WideCharAddr2Str(Tmp&)
Tmp& = My_AUDIOGetFileSize(Tmp&)
Print Größe (Bytes) =  + Str$(Tmp&)
Tmp& = My_AUDIOGetBitrate(Tmp&)
Print Bitrate =  + Str$(Tmp&)
Tmp& = My_AUDIOGetSampleRate(Tmp&)
Print Samplerate =  + Str$(Tmp&)
Tmp& = My_AUDIOGetChannels(Tmp&)
Print Kanäle =  + Str$(Tmp&)
Tmp& = My_AUDIOGetDuration()
Print Dauer (Sekunden) =  + Str$(Double(Tmp&))
Tmp& = My_AUDIOGetLastErrorNumber(Tmp&)
Print Letzter Fehler =  + Str$(Tmp&)
WaitInput
FreeDLL Dll
lass=s4 href='./../../Function-References/XProfan/end/'>End

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/26/08  
 



The duration of/ one MP3 is imho pure Berechnungssache, amount Bits dividiert through bits/s.

On [...]  standing supply The Spieldauer in sec, is so The Gesamtspieldauer or The currently-already-past-Spieldauer meant?
 
06/26/08  
 




RGH
iF
The duration of/ one MP3 is imho pure Berechnungssache, amount Bits dividiert through bits/s.

On [...]  standing supply The Spieldauer in sec, is so The Gesamtspieldauer or The currently-already-past-Spieldauer meant?


even if it The played duration in sec would, might at not launched Song not The Bitrate (as 32-bit-Integer) in the Result stand, that according Doku a 32-bit-Single is.

Very strange, the whole ...

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
06/26/08  
 



RGH
even if it The played duration in sec would, might at not launched Song not The Bitrate (as 32-bit-Integer) in the Result stand, that according Doku a 32-bit-Single is.

Very strange, the whole ...

Greeting
Roland


is still clear, it works as would here a tab pulled what before for Berechnungen necessary was - could means his the it one Folgefehler is because not sufficient of Stack abgeholt becomes.

with a little bit Inlineassembler get to the certainly quick out. (Frank? could You please times... Have my inlineasm strain downed...) *g*
 
06/26/08  
 



 
- Page 2 -



Georg
Hovenbitzer
@If
it'll here probably the Gesamtspieldauer meant his, there it in the OCX Version so is.
The function works there also and becomes of me @double umgesetzt.
The thereby entstehenden times voices too

@Roland
Stefan has on my question already answered:
>> Hi, for a 32bit float from C++ out. <<
comes from folgendem Forumsbeitrag: [...] 
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
06/26/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.023 Views

Untitledvor 0 min.
Gast.0815 vor 14 Tagen
Erasmus.Herold11/13/18
Michael Borowiak12/19/12

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie