Results 1 to 4 of 4

Thread: How to convert this?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    How to convert this?

    VB Code:
    1. Open lpMP3File For Binary As #1
    2.     Get #1, 1, Buf
    3.   Close #1
    to VB.NET?
    \m/\m/

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If I understand that vague function correctly , then it reads a binary file . Then , starts reading from the first byte (if it's not zero-based function) for 1 byte and save it in the Buf variable (which I suppose it's byte array) .


    Based on this , this is how it should be in .NET .
    VB Code:
    1. Dim byts(1) As Byte
    2. Dim strem As IO.Stream = New IO.FileStream("c:\xxx.LLL", IO.FileMode.Open)
    3.         strem.Read(byts, 1, 1)
    4.         strem.Close()
    5.  
    6.         For Each s As Byte In byts
    7.             MessageBox.Show(s.ToString)
    8.         Next

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ok here is a bigger part of the code, I'm showing this as I think the buffer must have at least 4096 bytes
    VB Code:
    1. Dim Buf As String '* 4096
    2.         Dim infoStr As String '* 3
    3.         Dim lpVBRinfo As VBRinfo
    4.         Dim tmpByte As Byte
    5.         Dim tmpNum As Byte
    6.         Dim i As Integer
    7.         Dim designator As Byte
    8.         Dim baseFreq As Single
    9.         Dim vbrBytes As Long
    10.  
    11.         Open lpMP3File For Binary As #1
    12.           Get #1, 1, Buf
    13.         Close #1
    14.  
    15.         For i = 1 To 4092
    16.             If Asc(Mid(Buf, i, 1)) = &HFF Then
    17.                 tmpByte = Asc(Mid(Buf, i + 1, 1))
    18.                 If Between(tmpByte, &HF2, &HF7) Or Between(tmpByte, &HFA, &HFF) Then
    19.                     Exit For
    20.                 End If
    21.             End If
    22.         Next i
    \m/\m/

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Ok , whatever the buffer size is , the idea is stil the same .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width