Solved

Create new wav file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

21 Experts available now in Live!

Get 1:1 Help Now