Results 1 to 3 of 3

Thread: mp3 cutting

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    3

    mp3 cutting

    Hi,

    For the past one week I have searched for the information regarding "getting Bitrate info from mp3 file" for purpose of doing mp3 cutting and I got it from the following link,


    http://www.planetsourcecode.com/vb/s...=4185&lngWId=1


    (Its name is "mp3_time_calc.vbp".This will display size, bitrate, frames, duration,version information of a mp3 file).

    Now I have another doubt. I have cut a mp3 file (for ex. sample.mp3 which is 128 kbps) into 4 equal parts (sample01.mp3,..,sample04.mp3) using binary file in VB6. Then I have played all the 4 mp3 files through winamp and winamp plays all the files.

    While playing "sample01.mp3" (First part) in Winamp, I have checked for the 'File Info', it displays the Bitrate as 128kbits correctly. Then for testing, I have checked to see the File info of sample01.mp3 file using that VB program namely "mp3_time_calc.vbp". It displays the information correctly.

    But While playing "sample02.mp3",.."sample04.mp4" (second part to fourth part) in Winamp, I have checked for the 'File Info', it displays the Bitrate as 128 kbits ofr second part, 256 kbits for third part and 448 kbits for fouth part. Also I have checked to see the File info of sample02.mp3 to sample04.mp3 files using the program "mp3_time_calc.vbp". But it throw an error called "Overflow".

    How to make the mp3 files to show the right information(i.e all the parts should show the same bitrate info like the original file). How to do this.

    Please help me.

    Thank you.



    The simple coding that I have used to cut the sample.mp3 is here,

    In General Declaration,

    Dim flen As Long
    Dim sptsize As Variant
    Dim str As String

    -------------------

    Private Sub cmdSplit_Click()
    filenum = FreeFile
    Open "F:\sample.mp3" For Binary As filenum
    flen = FileLen("F:\sample.mp3")
    sptsize = flen / 4
    str = String(sptsize, " ")
    Get #filenum, , str
    filenum1 = FreeFile
    Open "F:\sample01.mp3" For Binary As filenum1
    Put #filenum1, , str
    Close filenum1
    Get #filenum, , str
    Open "f:\sample02.mp3" For Binary As filenum1
    Put #filenum1, , str
    Close filenum1
    Get #filenum, , str
    Open "f:\sample03.mp3" For Binary As filenum1
    Put #filenum1, , str
    Close filenum1
    Get #filenum, , str
    Open "f:\sample04.mp3" For Binary As filenum1
    Put #filenum1, , str
    Close filenum1
    Close filenum
    MsgBox "File Splitted"
    End Sub

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    I took your code, made it a little more dynamic and put it into a new project of my own... I don't know, I'd download winamp again and see what the deal is. It works fine for me. See attached.
    Attached Files Attached Files
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    I guess the problem is that the header of the MP3 is only present on the first part. All the subsecuent files lack of the header... so Winamp detects what it can as the header and do their calculations. "Your" code cannot find the header or find something that could be the header but since it's not... the calculation raises a wrong number (and probably the Overflow error as well)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

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