Solved

Create new wav file

Posted on 2000-02-15
4
453 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

728 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