| View previous topic :: View next topic |
| Author |
Message |
H5N1Strain Newbie
Joined: 28 Apr 2010 Posts: 17
|
Posted: Sat May 29, 2010 8:05 am Post subject: WAV. Recording Alternative |
|
|
Hello Guys!
I have been recording .WAV files (5 seconds) though my microphone. I disconnect the microphone when I record. The reason I am doing this is so that when I record multiple files, I want to make sure that they are all identical. I check the files with an MD5 checksum and some files are identical, but, some files are different. I am recording using MCI. I am thinking that the file sizes are diferent because I use WAIT 5 in my script. Maybe VDS might not wait the 5 seconds acurately, therfore file sizes maybe smaller/larger. Is there a sound recording DLL available that I can try that may help with this problem? I am writing this script to detect when a sound is present, so if the MD5 matches the (idle WAV file), when a sound is played, the MD5 will be diferent.
Many Thanks...
Googie. |
|
| Back to top |
|
 |
H5N1Strain Newbie
Joined: 28 Apr 2010 Posts: 17
|
Posted: Sat May 29, 2010 8:12 am Post subject: |
|
|
Here is my code...
%%Wave1 = c:\1.wav
%A = @MCI(open new type waveaudio alias mysound)
%A = @mci(cue mysound input wait)
wait 2
%A = @MCI(record mysound)
WAIT 6
%A = @MCI(Stop mysound)
%A = @MCI(save mysound %%Wave1)
%A = @MCI(close mysound) |
|
| Back to top |
|
 |
H5N1Strain Newbie
Joined: 28 Apr 2010 Posts: 17
|
Posted: Sat May 29, 2010 10:47 am Post subject: |
|
|
| Hmmm.... Any Ideas Guys? |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat May 29, 2010 2:40 pm Post subject: |
|
|
That seems like a lot of disk activity.. There has to be a better way to accomplish what you are looking for.
If you have the ability to rewire your doorbell to the input of your soundcard, couldn't you instead wire it to a light? _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Sat May 29, 2010 3:05 pm Post subject: |
|
|
I dont think the sound will always be the same, no matter even if the time is exact. The doorbell can't be that precise to playback the exact same sound everytime; while it may sound the same to your ears it likely fluctuates.
I don't have code but one option is to check the decibel level that is being produced from the input of the soundcard; if it at a certain level (range) you know the door bell rang. |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat May 29, 2010 4:03 pm Post subject: |
|
|
PK, I believe he was trying to record silence, and then check for anything that didn't match that(silence).
Any tips or info on checking the input for sound/level? I couldn't find anything useful. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat May 29, 2010 6:26 pm Post subject: |
|
|
The problem with the md5 check sums is that VDS is not perfect at time, so you are going to run into millisecond or even nanosecond differences in the wav files which of course will cause the md5 check sum to be different.
The only way to do this is by a pattern of the decibels in the wav file itself. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
H5N1Strain Newbie
Joined: 28 Apr 2010 Posts: 17
|
Posted: Sun May 30, 2010 6:09 am Post subject: |
|
|
Thanks for your help guys! When I first came up with this idea I was looking for a way to check the DB of the Mic. I have been looking for info but couldnt find anything of use. So thats how I came to comparing .WAV files with MD5. So yeah, it looks like I am back to checking DB. Any ideas with that? Also, was suggested that I could turn on a light, I plan on trying that sometime in the future. I am really into home automation and hope to work in that field oneday.
Thanks Guys!
Googie. |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun May 30, 2010 5:38 pm Post subject: |
|
|
Aw, now if you're going to go with a webcam and a light, then you might have things a little easier!
Image comparison in VDS with a DLL (I think from Tommy Sools, but cant' remember which DLL) you can take timed snapshots and compare them to the previous image taken, if there's too much of a difference in the snapshots, then you have a major change, such as a light came on. I am not talking about image size, I mean you take a sampling of pixels spread out over the image and compare the color values. If the values have changed greatly, then something within the image has greatly changed. My original intent for this code was for personal home security, to detect if someone was in my home and to start recording the various webcams I had and to then send out alerts via emails, sms or phone. I never got that far though and only got as far as doing the front door setup.
I did have something like this going myself many many years ago and it worked perfectly. I had a webcam set outside my front door and if anyone walked up to my door, my program alerted me to this. See, my room was upstairs, we don't have a doorbell and I'd never hear anyone knocking at the front door, so I needed something to help me with that problem.
I doubt I still have the source codes for this as I've had a lot of HD crashes since those days, but I'll look around and see. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|