Mega Code Archive

 
Categories / Delphi / Examples
 

Sound

For lots of Delphi source for sound + multimedia applications check out http://www.swiftsoft.de/ OR Hi, Have a look at: http://www.xaudio.com/ Check the developers section. Good luck! OR Try this one too: http://www.xaudio.com/ A free MP3 SDK for Delphi and Builder... It's great :-) /Martin << Does anybody know how to record a wave file in delphi - but start recording only when there's some noise in the room - i.e. I need a "voice activated recorder"? >> From: ACMDOC@aol.com Date sent: Sun, 14 Mar 1999 12:38:45 EST To: Delphi@Kyler.com, selensky@plovdiv.itdnet.net Subject: Re: Recording wave files with voice activation Send reply to: Delphi@Kyler.com In a message dated 3/14/1999 6:19:59 AM Eastern Standard Time, selensky@plovdiv.itdnet.net writes: To record incoming sounds you need to use the low-level wave input functions in mmsystem.pas. This in itself is not trivial. First you need to find a suitable device using the waveInNumDevs() and waveInGetDevCaps() functions. Once you have located and opened a suitable device, you need to allocate data buffer block that will hold the incoming sound to be recorded. In both low- level recording and playback it is good to use at least two buffers (double buffering) so that the program can work with one buffer while the system works with the other. Once you have allocated the memory for the data buffers, you need to be "prepared" by calling waveInPrepareHeader(). Then you actually fill the buffer with data by calling waveInAddBuffer(). This adds it to the system queue for processing. You can specify a callback routine in the waveInOpen() function to deal with wave input messages. The device then processes the sound. You need to clean things up also -- you need to "Unprepare" any buffer you're using by calling waveInUnprepareHeader() before you can reuse it. At the end, you need to free all memory you allocated, needless to say. I told you this wasn't trivial, and I may not have included all of the steps -- just given you a general outline to get started. (BTW, Keith Elias and I have submitted an article to Delphi Informant using this kind of functionality to add phone call recording capabilities to TAPI). << So, how can I screen the input level of the mic? >> This is something I have not investigated. It may be possible with the multimedia API. There may also be SAPI functions that support this, but again, I have not looked into it yet. << I also need to compress the input data as much as possible... I need to be able to record as much time as I can on a limited HDD space... >> Let me recommend a fine book on working with sound that does get into a discussion of sound compression: "A Programer's Guide to Sound" by Tim Kientzle (Addison-Wesley). Good luck, Alan C. Moore Contributing Editor Delphi Informant ********************** To: <Delphi@Kyler.com> Subject: Re: Sound through a modem ? Date sent: Sun, 28 Mar 1999 00:05:01 -0600 Send reply to: Delphi@Kyler.com hi... i thought i new of some example code that i had on this subject and sure enough i found it on a cd i have called, "delphi 2.0 programmer's utilities power pack". the cd is collectioin of apps and source code (probably all pulled down from the web). the demo app is called ansmach.zip. it is supposed to handle voice and everything. i would either look for the cd or probably you can just pull this one down form the dsp. i would search the the dsp first. while your at it you may want to go out to the jedi site - (i believe there is a link to project jedi from the dsp) and download what they have on tapi. the full implementation is supposed to be done and will probably have some excellent demos on the subject. mark -----Original Message----- From: Sebastien Buysse <buitoni@altavista.net> To: Delphi@Kyler.com <Delphi@Kyler.com> Date: Saturday, March 27, 1999 9:40 PM Subject: Sound through a modem ? >Hello, > >Some modems can act like answering machines. And i would like >to be able to send (through a delphi program of course) a wave >to the phone line... >if it's possible, i also would like to record a wave from the line >and also detect when the user push a number ... >i think we could make exceptional application for dumb people. > >thanks for your help. > >Sebastien