Quick Search for:  in language:    
wrote,Delphi,Code,Records,from,your,Microphon
   Code/Articles  |  Newest/Best  |  Community  |  Jobs  |  Other  |  Goto  | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Delphi Stats

 Code: 209,911. lines
 Jobs: 14. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for Delphi
Recycle Bin name changer
By ShoBaiR ShaIkhY on 12/30


Ninth backdoor 2003
By k0nsl on 12/27


Tank game 0.02
By Peter Williams on 12/25


Click here to see a screenshot of this code!HTML Table Generator
By James Edward Seddon on 12/23

(Screen Shot)

Occurs( )!! Superb Quick! Number of Occurence in a String
By Eros Tse on 12/17


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Record From Microphone to Wave File

Print
Email
 
VB icon
Submitted on: 11/25/2003 4:13:23 AM
By: Una-Rat 
Level: Beginner
User Rating: Unrated
Compatibility:Delphi 7, Delphi 6, Delphi 5, Delphi 4

Users have accessed this code 1086 times.
 
(About the author)
 
     I wrote this in Delphi 6. This Code Records from your Microphone and Saves it to the Hard drive as a .wav file. Just add mmSystem to the Uses and insert the code.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    !**************************************
    ! Name: Record From Microphone to Wave F
    !     ile
    ! Description:I wrote this in Delphi 6. 
    !     This Code Records from your Microphone a
    !     nd Saves it to the Hard drive as a .wav 
    !     file. Just add mmSystem to the Uses and 
    !     insert the code.
    ! By: Una-Rat
    !
    !This code is copyrighted and has    ! limited warranties.Please see http://w
    !     ww.Planet-Source-Code.com/vb/scripts/Sho
    !     wCode.asp?txtCodeId=1281&lngWId;=7    !for details.    !**************************************
    
    {
    1. Add mmSystem To the Uses.
    2. Add 3 buttons to your Form.
    3. Button 1 is for Record.
    4. Button 2 is for Stopping the Recording.
    5. Button 3 is for Saving the Recorded wav. 
    I'v found very few sources on recording from a mic
    and all of these sources look almost identical. So
    this is my version and I'm sure it will look the
    same as any of you making your own version's of
    the code. So use it how you want and if your version
    is better than mine, I'd like to have a copy of it.
    Happy Coding!
    }
    // Record
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    mciSendString('OPEN NEW TYPE WAVEAUDIO ALIAS MicSound', nil, 0, Handle);
    // MicSound is what the WaveAudio is asigned to.
    // It is used in all the mciSendString so if you
    // rename it to a diffrent name then you need to
    // make sure you change it on all of them.
    // If you dont know what I just said..
    // hell I dont think I know what i just said
    // then leave it the way it is, it will work ether way.
    // The Following is pritty much self explanatory but I put
    // the Notes out for those who dont follow.
    mciSendString('SET MicSound TIME FORMAT MS ' +// set the time format
    'BITSPERSAMPLE 8 ' +// 8 Bit 
    'CHANNELS 1 ' + // MONO 
    'SAMPLESPERSEC 8000 ' + // 8 KHz 
    'BYTESPERSEC 8000', // 8000 Bytes/s 
    nil, 0, Handle); 
    mciSendString('RECORD MicSound', nil, 0, Handle); 
    end; 
    // Stop Record
    procedure TForm1.Button2Click(Sender: TObject); 
    begin 
    mciSendString('STOP MicSound', nil, 0, Handle); 
    end; 
    // Save Wave File
    procedure TForm1.Button3Click(Sender: TObject);
    begin 
    mciSendString(PChar('SAVE MicSound ' + 'C:\FileName.wav'), nil, 0, Handle);
    mciSendString('CLOSE MicSound', nil, 0, Handle); 
    end;
    {
    If you like the code then please vote.
    And if anyone finds a source for changing Wav to Mp3,
    Please let me know, I could realy use it.
    }


Other 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
12/1/2003 1:09:37 AM:K. O. Thaha Hussain
That code is great! It is working 
fine!
Thaha Hussain, Systems 
Analyst, BAH
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/1/2003 1:28:49 AM:Una-Rat
Thanks for posting, I like the feedback 
but I need some votes also :D
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Delphi Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.