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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record audio within a VFP application

Status
Not open for further replies.

Nabarun

Programmer
Jul 24, 2021
7
IN
Hello I am a new programmer named Nabarun. Could you please help me with recording audio in VFP?
 
I have seen that thread and applied it in my program but it doesn't seem to work and I can't save my file.
 
Which version of Windows are you using?

The reason I ask is that most versions have an audio recorder app, but it is a different app for different versions. For example, there was once something called sndrec32.exe. I think that was replaced at some point by Sound Recorder, and then by the Windows Media Player. (I'm not up to date on this; I'm posting it from memory.)

Some or all of those apps use command-line parameters, which makes them easy to automate from VFP. So if you know which app you have installed, it should be possible to research the relevant parameters. And if you don't have such an app, you should be able to download a suitable program from somewhere.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Did you read the whole thread? wgcs says that's the very problem of his code not doing anything with the file name parameter, he gives the necessary extension in a later post, the SAVE mci command.

Chriss
 
Mike,I am using Windows 10 and have windows media player.
Yes,Chris I have seen that command and applied it but it doesn't work. Will you tell me one thing that I will need c:\source\WINUTIL.VCX or not for this function? Please tell me quickly.
 
NO, wgcs just pointed out the method comes from there and is modified, but there is no class reference going back, he has a class mci based on container and the other based on that.

The only thing missing is that the RecordNew() method doesn't do anything with the filename. The save method calls the save command, but doesn't use the file name. That's what he mentions within a later post in the thread.

Chriss
 
What you need is a form, this is just a container class. You need at least one button to stop and save the recording. It needst to call both stop and save and the file name initially passed to RecordNew.

Chriss
 
Those other two threads have got nothing to do with recording audio. Any replies should be made in the threads themselves, not here. In fact, you have already received some replies in the threads.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
A tip to maybe find errors. Add some logging to the sendstring Procedure. In the simplest case like this:

Code:
*-- mciSendString( cString, @cReturn, nRetLen, wHnd )
    PROCEDURE sendstring
        LPARAMETERS cString
        LOCAL cRet, err
        cRet = space(60)
        err = mciSendString(cString,@cRet,60,0) 

        ? cString, err, cRet

        return cRet
    ENDPROC

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top