Solved

Create new wav file

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
QRReport  TQrmemo vertical stretching 1 52
Create a path if not exists 7 89
Delphi Yen format 3 45
Delphi: sending SMS on android platform 1 32
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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