forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


WAV. Recording Alternative

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
H5N1Strain
Newbie


Joined: 28 Apr 2010
Posts: 17

PostPosted: Sat May 29, 2010 8:05 am    Post subject: WAV. Recording Alternative Reply with quote

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
View user's profile Send private message
H5N1Strain
Newbie


Joined: 28 Apr 2010
Posts: 17

PostPosted: Sat May 29, 2010 8:12 am    Post subject: Reply with quote

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
View user's profile Send private message
H5N1Strain
Newbie


Joined: 28 Apr 2010
Posts: 17

PostPosted: Sat May 29, 2010 10:47 am    Post subject: Reply with quote

Hmmm.... Any Ideas Guys?
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sat May 29, 2010 2:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Sat May 29, 2010 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sat May 29, 2010 4:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat May 29, 2010 6:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
H5N1Strain
Newbie


Joined: 28 Apr 2010
Posts: 17

PostPosted: Sun May 30, 2010 6:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun May 30, 2010 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group