Results 1 to 4 of 4

Thread: Mp3 - Wav

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Aberdeen
    Posts
    32

    Mp3 - Wav

    Hmm,

    This should be easy, but for some reason i just can't get my head round it and i'd appreciate a pointer or 2....

    How can i create a new wav file from an existing MP3 file.

    I know people are gonna say "but the file size will be enormous, why bother" and your quite right.

    This aint for me, but a friend asked, and i said i would take a look at it.....

    Any tips would be greatly appreciated, but as ususal the answer is more than likely staring me right in the face.

    Regards

    JTC

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You can use a program called CDex from http://cdex.n3.net . It has capabilities to decode and encode mp3/wav files. It's what I used to rip MP3s to wav and record the wav to cd before I bought Nero.
    <removed by admin>

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Aberdeen
    Posts
    32
    thanks for the speedy reply but what i had in mind was more along the lines of a way to include that sort of functionality into another app

    any ideas??


    JTC

  4. #4
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    See here: Works a charm!

    This was posted by DJDannyK:

    code:--------------------------------------------------------------------------------Private Sub cmdOpen_Click()
    Dim cmdToDo As String * 255
    Dim dwReturn As Long
    Dim ret As String * 128
    Dim tmp As String * 255
    Dim lenShort As Long
    Dim ShortPathAndFie As String

    Filename = "C:\MyMp3.mp3"

    If Dir(FileName) = "" Then
    mmOpen = "Error with input file"
    Exit Function
    End If
    lenShort = GetShortPathName(FileName, tmp, 255)
    ShortPathAndFie = Left$(tmp, lenShort)
    glo_hWnd = hwnd
    cmdToDo = "open " & ShortPathAndFie & " type MPEGVideo Alias mpeg"
    dwReturn = mciSendString(cmdToDo, 0&, 0&, 0&)

    If dwReturn <> 0 Then 'not success
    mciGetErrorString dwReturn, ret, 128
    mmOpen = ret
    MsgBox ret, vbCritical
    Exit Sub
    End If

    End Sub--------------------------------------------------------------------------------


    This should open your mp3 ready to play/record
    Then under the play button put this bit of code

    code:--------------------------------------------------------------------------------Private Sub cmdPlay_Click()
    Dim dwreturn As Long
    Dim ret As String * 128
    Dim mmopen As String
    mciSendString "open new type waveaudio Alias tune", 0&, 0&, 0&
    mciSendString "record tune", 0&, 0, 0 'play the mp3 after this one
    dwreturn = mciSendString("play mpeg", 0&, 0&, 0&)

    If dwreturn <> 0 Then
    mciGetErrorString dwreturn, ret, 128
    mmopen = ret
    MsgBox ret, vbCritical
    Exit Sub
    End If

    End Sub--------------------------------------------------------------------------------


    Leave your computer alone until the song has finished playing then click the stop button, and voila you should have a new wav file


    code:--------------------------------------------------------------------------------Private Sub cmdStop_Click()
    Dim dwreturn(1 To 3) As Long
    Dim ret As String * 128
    dwreturn(1) = mciSendString("stop tune", 0&, 0&, 0&)
    dwreturn(2) = mciSendString("save tune c:\NewTune.wav", 0&, 0&, 0&)
    dwreturn(3) = mciSendString("close tune", 0&, 0&, 0&)
    'check each command sent
    For i = 1 To 3
    If dwreturn(i) <> 0 Then
    mciGetErrorString dwreturn(i), ret, 128
    mmopen = ret
    MsgBox ret, vbCritical
    RecordMode = False
    Exit Function
    End If
    Next i
    'sucess if we reach here

    End Function

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