la cos amigliore sarebbe che allegassi un file sid, così possiamo fare delle prove.
cmq prova con qualcosa del genere
Public Sub screenplayer()
Dim stringa, risultato, subsong As String
Dim righe As New String[]
Dim i As Integer
'Exec ["uade123", "-g", song] To stringa
'prova con questa riga
hprocess = Shell "uade123 -g " & song For Read Write As "hprocess"
'oppure con questa
'hprocess = Shell "uade123 -g " & song For Input Output As "hprocess"
If stringa = "" Then
TextArea1.text = "Unknow format module"
ami.Label9.text = "0"
Return
Else
TextArea1.Clear
Endif
TextArea1.Clear
righe = Split(stringa, "\n")
For i = 0 To 3
Try TextArea1.text = TextArea1.text & righe[i] & "\n"
If Error Then Return
Next
If righe[3] = "" Then
subsong = righe[1]
Else
subsong = righe[3]
End If
subsong = Right(subsong, 18)
subsong = Trim(Replace(subsong, "(cur, min, max)", ""))
If Len(subsong) <= 2 Then
Ami.label7.text = subsong
Else
ami.label7.text = "0"
End If
End
Public Sub hprocess_read()
Dim sBuf As String
If Lof(hprocess) Then
Read #hprocess, sBuf, Lof(hprocess)
TextArea1.Insert(sBuf)
End If
End
ps ricordati di mettere in cima a tutto la dichiarazione
private hprocess as process
la cos amigliore sarebbe che allegassi un file sid, così possiamo fare delle prove.
cmq prova con qualcosa del genere
Public Sub screenplayer()
Dim stringa, risultato, subsong As String
Dim righe As New String[]
Dim i As Integer
'Exec ["uade123", "-g", song] To stringa
'prova con questa riga
hprocess = Shell "uade123 -g " & song For Read Write As "hprocess"
'oppure con questa
'hprocess = Shell "uade123 -g " & song For Input Output As "hprocess"
If stringa = "" Then
TextArea1.text = "Unknow format module"
ami.Label9.text = "0"
Return
Else
TextArea1.Clear
Endif
TextArea1.Clear
righe = Split(stringa, "\n")
For i = 0 To 3
Try TextArea1.text = TextArea1.text & righe[i] & "\n"
If Error Then Return
Next
If righe[3] = "" Then
subsong = righe[1]
Else
subsong = righe[3]
End If
subsong = Right(subsong, 18)
subsong = Trim(Replace(subsong, "(cur, min, max)", ""))
If Len(subsong) <= 2 Then
Ami.label7.text = subsong
Else
ami.label7.text = "0"
End If
End
Public Sub hprocess_read()
Dim sBuf As String
If Lof(hprocess) Then
Read #hprocess, sBuf, Lof(hprocess)
TextArea1.Insert(sBuf)
End If
End
Intanto grazie per l'aiuto.
Ho testato la tua soluzione, avevo fatto in precedenza una prova del genere senza esiti positivi, comunque vi allego un paio di file per dei test.
questo è compatibile con uade e deve essere estratto in una cartella a piacimento:
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FHuelsbeck_Chris%2FTurrican_2.lha
questo con sidplayer:
http://hvsc.perff.dk/MUSICIANS/T/Tel_Jeroen/Noisy_Pillars.sid
@fsurfing il tuo codice è corretto ma credo faccia la stessa cosa di quello che avevo implementato io:
Public Sub Process_Read()
Dim sLine As String
Dim sottoS As String[]
Dim i As Integer
Try Read #$hProcess, sLine, -256
label2.text &= sLine & gb.newline
End
Tutto sommato l'output che ne deriva potrebbe anche andar bene, il problema principale è ottenere un risultato simile anche con sidplay2 e xmp