PDA

View Full Version : DMCSCRIPTINGLib



streammaster
07-05-2007, 01:47 PM
hello,
in my project i want to use a progressbar. Does the DMCSCRIPTNGLib support any function how much of the conversation is done?

Iīve tried the scripting engine with the RedirectStandardOutput to use the little "*" with the RegularExpressions class but only when the conversation is done the .Readline get the 59 "*".

I also used the RedirectStandardError pipe.

thank you

streammaster

Spoon
07-05-2007, 03:48 PM
Reading the * is as close as you can get to getting the progress bars through scripting.

donny
07-05-2007, 06:41 PM
well many progress bars are unprecise, so try filing it up as you go... one of the main reasons for progres bars are that you see that something is happening...

is it always 59? or it depends on the file length?

Spoon
07-06-2007, 04:33 AM
Should end at 60

streammaster
07-31-2007, 08:27 AM
hello,

thank you for that

now i found a method to create a progressbar with the bassenc.dll

it works fine if I use the lame encoder.


here is the code:


Private Sub Dataform_Start()
Dim buffer(20000) As Byte
Dim inx As Long, wmahandle As Long, StreamID As Long
Dim strcmd As String
'this works fine --------->strcmd = App.Path & "\lame.exe " & "-b 192 " & "- " & Outputfile


'Initialisiert Player
Call BASS_SetConfig(BASS_CONFIG_FLOATDSP, BASSTRUE)
Call BASS_Init(1, 44100, 0, Dataform.hWnd, 0)

'Input Stream for Stdin
StreamID = BASS_StreamCreateFile(BASSFALSE, InputFile, 0, 0, BASS_STREAM_DECODE)
If StreamID = 0 Then
MsgBox "Kann keinen Stream erzeugen!"
Exit Sub
End If

' ----> this line is my problem the coreconverter always want a infile but it is delivered with the bassenc.dll (StreamID)
'(if I place here the inputfile then the progressbar didnīt work)
strcmd = App.Path & "\coreconverter.exe -errorfile=" & App.Path & "\error.txt" & " -outfile=" & """" & Outputfile & """" & " -convert_to = " & """mp3 (Lame)"""




frmRecTest.ProgressBar1.max = BASS_ChannelGetLength(StreamID)



'this call the commandline
Call BASS_Encode_Start(StreamID, strcmd, BASS_ENCODE_FP_16BIT, vbNull, 0)



RaiseEvent setDecodebar(BASS_ChannelGetLength(StreamID)) 'Infobar setzen




Do While BASS_ChannelIsActive(StreamID)

inx = BASS_ChannelGetData(StreamID, buffer(0), 19999)
RaiseEvent Decodebar(inx)
DoEvents
Loop



Call BASS_Encode_Stop(StreamID)
Call BASS_StreamFree(StreamID)
Call BASS_Free
RaiseEvent ready(True)
Set Dataform = Nothing
frmRecTest.ProgressBar1.value = 0
frmRecTest.ProgressBar1.max = 1


coreconverter use the stdin also as lame.
did you know whatīs wrong in the code?

thank you

streammaster

Spoon
07-31-2007, 02:32 PM
When using std in with coreconverter you have to psss the channels, frequency and bits on command line, the data should be supplied with no wave headers.