Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert MP3 to WAV 8bit Mono in VFP

Status
Not open for further replies.

EzLogic

Programmer
Joined
Aug 21, 2001
Messages
1,230
Location
US
Does anyone know how to convert any MP3 file to a WAV file 8Bit MONO in VFP?





Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
MP3 isn't native to windows, and VFP doesn't have sound stuff built in, so I'd say that you'd have to use some third-party tool to do it, which could be automated within VFP.

Theres a small likelihood that you could get to the Windows sound encoding system through an API to use an MP3 codec that is registered in windows (say, through DirectSound or something), but I don't know personally how to do that.
 
If you just want to play MP3's from VFP and you have
Windows Media Player 7 or above installed, this will
show a possibility. Otherwise, you'll need as suggested,
either a third-party solution or some serious coding.

Darrell

Code:
Local oWmp, oTmr
oWmp = CREATEOBJECT("WMPlayer.OCX")
oTmr = CREATEOBJECT("clsStopPlayer",oWmp)

oWmp.url = ;
"[URL unfurl="true"]http://w1.340.telia.com/~u34007636/public_html/godahopp/mp3/LadyMadonna.mp3"[/URL]

Read EVENTS

Define CLASS clsStopPlayer AS TIMER
  Enabled = .T.
  Interval = 5000
  oWmp = NULL
  Protected PROCEDURE INIT
    Lparam oWMPlayer
    This.oWmp = oWMPlayer
  Endproc

  Protected PROCEDURE TIMER
    With THIS
      .ENABLED = .F.
      Local bStop
      bStop = MESSAGEBOX("Stop player?",36,"WM Player") == 6
      If bStop .AND. .oWmp.PlayState==3
        .oWmp.CLOSE()
        .oWmp = NULL
        Clear EVENTS
      Else
        If .oWmp.PlayState == 1
          .oWmp = NULL
          Clear EVENTS
        Else
          .ENABLED = .T.
        Endif
      Endif

    Endwith
  Endproc
Enddefine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top