Create a new .wav file from an existing .wav file based on the date 
Author Message
 Create a new .wav file from an existing .wav file based on the date

I'm trying to write a small script that will allow me to create a new wav
file by copying/renaming an existing wav file based on the date.

Basically, I have several wav files recorded each saying a specific portion
of a date. For instance, monday.wav simply says "Monday". april.wav says
"April", and so on.

So, based on the computer's date, I want to use these existing wav files to
create 3 new wav files: CurrentDay.wav, CurrentMonth.wav, and
CurrentNumber.wav.

I could then put them into a subroutine I already have that will "speak the
date" correctly all the time... "Today is Monday, February 10th".

It seems like a simple procedure, but I just can't figure it out. Any input
would be greatly appreciated,

Bob Brislin



Sat, 30 Jul 2005 01:26:40 GMT  
 Create a new .wav file from an existing .wav file based on the date
Here is a way to parse the date to get the parts of the date ...

aDate      = Split(_
             Replace(_
             FormatDateTime(Date, vbLongDate), _
             " ", ","), _
             ",")
sDayName   = aDate(0)
sMonthName = aDate(2)
sDayNumb   = aDate(3)
sYear      = aDate(5)

Then assuming the files with the proper names exist in the target
folder, the FSO CopyFile method should do the trick, something like
this ...

' <CAUTION><AIRCODE>
  sPathSpec = "D:\Somplace\or\Other\"
  sCurrentMonth = "E:\Wherever\CurrentDay.wav"
  sCurrentMonth = "E:\Wherever\CurrentMonth.wav"
  with CreateObject("Scripting.FileSystemObject")
    if exist .FileExists(sPathspec & sDayName & ".wav") Then _
       .CopyFile sPathspec & sDayName & ".wav", CurrentDay
    if exist .FileExists(sPathspec & sMonthName & ".wav") Then _
       .CopyFile sPathspec & sMonthName & ".wav", CurrentMonth
    if exist .FileExists(sPathspec & sDayNumb & ".wav") Then _
       .CopyFile sPathspec & sDayNumb & ".wav", CurrentDayNumber
  End With
' </AIRCODE></CAUTION>

Not the most efficient, but I hope you get the idea.

Tom Lavedas
===========

Quote:

> I'm trying to write a small script that will allow me to create a new wav
> file by copying/renaming an existing wav file based on the date.

> Basically, I have several wav files recorded each saying a specific portion
> of a date. For instance, monday.wav simply says "Monday". april.wav says
> "April", and so on.

> So, based on the computer's date, I want to use these existing wav files to
> create 3 new wav files: CurrentDay.wav, CurrentMonth.wav, and
> CurrentNumber.wav.

> I could then put them into a subroutine I already have that will "speak the
> date" correctly all the time... "Today is Monday, February 10th".

> It seems like a simple procedure, but I just can't figure it out. Any input
> would be greatly appreciated,

> Bob Brislin




Sat, 30 Jul 2005 06:24:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Create a new .wav file from an exisitng .wav file

2. inserting wav files into other wav files

3. opening resource file-based WAV files

4. opening resource file-based WAV files

5. .vbs file to play a .wav if file size does not equal 0

6. Playing a .wav File from a .vbs File

7. New .WAV File player

8. Recording to New WAV file

9. Help me create a wav file!!!!

10. Create Small Wav Files in VB

11. Help me create a wav file!!!!

12. How do you create WAV files in ADPCM format

 

 
Powered by phpBB® Forum Software