Solved

Create new wav file

Posted on 2000-02-15
4
442 Views
Last Modified: 2010-04-04
I did a program in delphi 3.0 to record a wav file. I manage to record using media player. the file i create was saved in c:\sound.wav.

The problem is, I can't save in a new file. the sound I recorded keep on append to the c:\sound.wav

Thank you.
0
Comment
Question by:cjong75
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 2521785
Set the FileName property to the filename you want it saved as.

Cheers,

Raymond.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2528708
do mediaplayer1.close;
mediaplayer1.filename:= newfilename;
mediaplayer1.open;
0
 

Author Comment

by:cjong75
ID: 2530258

If the file c:\sound.wav didn't exist, then i can't save the file i've recorded.(an error message appear .. something to do with EMCI error).The program halted.

Then, i create a fail name sound.wav in c:\ to solve the problem.

The program can run and the recorded voice can be saved in c:\sound.wav
But, each time i record my voice it does not overwrite the existing file(sound.wav).

Thank you.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2532411
"""If the file c:\sound.wav didn't exist, then i can't save the file i've recorded
""""

do this:

Var fl: TFileStream;

fl:= TFileStream.Create('c:\sound.wav',fmOpenWrite);
fl.Free;


"""But, each time i record my voice it does not overwrite the existing file(sound.wav).
""""
do this then:

if FileExists('c:\sound.wav') then DeleteFile('c:\sound.wav);

before recording..


you can use both things together.. first check if file exists, if so, delete it..
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now