Solved

Create new wav file

Posted on 2000-02-15
4
444 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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