User Login

Help Community Login:

random sound app

7 replies [Last post]
Evil Monkey's picture
Evil Monkey
Moderator (Watching Over The Masses)Premium Member (Silver)The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariI'm Here To Help, & Have Proven It!Windows UserMember of VileThe JokerSomeone thinks you're a Rotten Tomato!STaRDoGG <3's you ;)
Joined: 01/22/2009
Posts: 234
Drops: 350

 Hey Dogg,

I want to write a small app that will randomly play a sound file that I add into the app. I was thinking of creating a random number generator of like 0-10,000 (have to figure out how many seconds in a day) and when it get's to 0 play the sound then create another random number and repeat. I want it to keep goign until I tell it to stop with a button.  The catch is I don't want it to be visible I want it to run in the background so the user can't see the app. It's  been a while since I putzed around with vb.  This seems pretty easy to do?

EDIT:  OK new idea to add. I'd like to maybe throw in other events other then just a sound file.  Maybe have it randomly open and close the cd rom tray.  Or some other wierd things I can think of that wouldn't be to hard to implement.  Trying to basically play a prank on someone and want his pc to start doing wierd things on it's own.  This seem like more work then it's worth or would it be pretty easy?

I Averaged: 0 | 0 votes

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
STaRDoGG's picture
From:
Olympus
STaRDoGG
Head Mucky MuckJoined the Dark SidePremium Member (Gold)I'm a Code Monkey!The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariLinux UserMac UserWindows UserI donated to GeekDrop simply because I love it!Booga Booga BoogaI took a bite of the AppleFormer Phrozen Crew MemberI'm MagicMember of VileThe Dr. put the stem on the apple!The JokerSomeone thinks you're udderly delightful!
Relationship Status:
Single & Not Looking
Joined: 01/14/2009
Posts: 2622
Drops: 3109
Mood: Energetic
Re: random sound app

Playing a random sound is easy. Just create a function that generates a random number between whatever you want, then add a timer control to the form, set to trigger like once per minute. When it fires have it check the random number to see if it's time to play the sound, if it is play it, if not don't. When the sound is played call the function to generate a new random number. Rinse and repeat as necessary.

Here's a generic random number generator function I wrote that I use whenever I need to get a random number:

In the Declarations area put this:

' Initialize random number generator
Dim r As New Random(System.DateTime.Now.Millisecond)
 
' Contains the generated random time
Public strTime As String = String.Empty ' You'll probably want to change this from a string to a number type of variable

Then here's the function.

 Public Function GenerateRandomNumber(ByVal intMin As Integer, ByVal intMax As Integer) As Integer
 
    GenerateRandomNumber = 0
    Return r.Next(intMin, intMax)
End Function

Example syntax for calling it:
strTime = GenerateRandomNumber(0, 19)

As for the CD Tray opening, etc. you can use the same random number generator for those too, and just look up System / Hardware functions and API's. For example: mciSendString

To make the form / program invisible to the user just set form.visible = false. Just make sure you set some way to make it visible again. Maybe have it detect a certain word typed into text areas or something.



Shhh.. dont tell anyone, but we also have a private forum area with the really good stuff, wanna see?

Evil Monkey's picture
Evil Monkey
Moderator (Watching Over The Masses)Premium Member (Silver)The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariI'm Here To Help, & Have Proven It!Windows UserMember of VileThe JokerSomeone thinks you're a Rotten Tomato!STaRDoGG <3's you ;)
Joined: 01/22/2009
Posts: 234
Drops: 350
Re: random sound app

Cool Thanks, If I can find the time I'll start working on this. Were pulling pranks around the office lately. Started with my april fools joke I played on a girl I work with. She has a personal printer so I created a small crude drawing of a penis This My Penis penis actually Smile . I printed a bunch out on blank sheets of paper and filled them randomly in her printer tray. After a few day's she realized she had been printing a faint small watermark in the shape of a penis! I had the joke going for 2 weeks straight before I finally had to break it to her. She could not figure out what was going on. She even googled the situation and gave her self a virus by doing so!!! it was priceless. I started to move the penis picture around the pages and make them bigger. It was seriously hallarious.

So now I want to write this app and throw it on someones pc. It may confuse them at first then eventually they will think they have a virus
Anyway I'm sure I'll be hitting you up for a hand if I do start working on this. Thanks again!



I believe in making the world safe for our children, but not our children's children, Because I don't think children should be having sex.

STaRDoGG's picture
From:
Olympus
STaRDoGG
Head Mucky MuckJoined the Dark SidePremium Member (Gold)I'm a Code Monkey!The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariLinux UserMac UserWindows UserI donated to GeekDrop simply because I love it!Booga Booga BoogaI took a bite of the AppleFormer Phrozen Crew MemberI'm MagicMember of VileThe Dr. put the stem on the apple!The JokerSomeone thinks you're udderly delightful!
Relationship Status:
Single & Not Looking
Joined: 01/14/2009
Posts: 2622
Drops: 3109
Mood: Energetic
Re: random sound app
Evil Monkey wrote:

She even googled the situation and gave her self a virus by doing so!!!

So now I want to write this app and throw it on someones pc. It may confuse them at first then eventually they will think they have a virus

Laughing, are you also being inundated with tech support tickets because everyone (or just her right now) need their puter fixed? You're still doing desktop software support / repair aren't ya?



Shhh.. dont tell anyone, but we also have a private forum area with the really good stuff, wanna see?

Evil Monkey's picture
Evil Monkey
Moderator (Watching Over The Masses)Premium Member (Silver)The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariI'm Here To Help, & Have Proven It!Windows UserMember of VileThe JokerSomeone thinks you're a Rotten Tomato!STaRDoGG <3's you ;)
Joined: 01/22/2009
Posts: 234
Drops: 350
Re: random sound app

I do everything from desktop support, server support, building images, writing jobs you name it.  

OK I got the meat and potatos of my app done last night.   Here's a screenie, 

Basically each set of numbers will kick off a sound if they both match. I plan to add in lables per sound event to keep a running total of each time one is kicked off. It got late last night and didn't get that done.  Wont take long to add that counter in though. I havn't messed with the CD tray thing.  That may be next to get included.  But I like my little bug.  hehehe good fun on coworkers pc's.  Oh I forgot. I made it to run invisible. I added in hot key's to be able show or hide.  But by default it's hidden.  



I believe in making the world safe for our children, but not our children's children, Because I don't think children should be having sex.

Evil Monkey's picture
Evil Monkey
Moderator (Watching Over The Masses)Premium Member (Silver)The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariI'm Here To Help, & Have Proven It!Windows UserMember of VileThe JokerSomeone thinks you're a Rotten Tomato!STaRDoGG <3's you ;)
Joined: 01/22/2009
Posts: 234
Drops: 350
Re: random sound app

K I think i'm done with this thing. I dont' know why but I like this little app.  All it does is randomly play some dumb sounds but it's fun to use to mess with people.  Anyway here is an updated screen shot! I threw on some counters to keep track of how many times a sound plays.  Also threw a stop watch on it to see how long the app has been running.  Oh and just added buttons to preview the sounds at any time you want. 



I believe in making the world safe for our children, but not our children's children, Because I don't think children should be having sex.

STaRDoGG's picture
From:
Olympus
STaRDoGG
Head Mucky MuckJoined the Dark SidePremium Member (Gold)I'm a Code Monkey!The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariLinux UserMac UserWindows UserI donated to GeekDrop simply because I love it!Booga Booga BoogaI took a bite of the AppleFormer Phrozen Crew MemberI'm MagicMember of VileThe Dr. put the stem on the apple!The JokerSomeone thinks you're udderly delightful!
Relationship Status:
Single & Not Looking
Joined: 01/14/2009
Posts: 2622
Drops: 3109
Mood: Energetic
Re: random sound app

Yep, that's the best way to learn when starting out, just writing small little fun tools that do whatever you want. You basically just wrote a very mini, BackOrifice type of app, Laughing. You could also code in a way to remotely kill it in case for some reason you lose direct access to the "victims" computer. That way it wouldn't be doing all kinds of crazy stuff on there permanently, ROFL



Shhh.. dont tell anyone, but we also have a private forum area with the really good stuff, wanna see?

Evil Monkey's picture
Evil Monkey
Moderator (Watching Over The Masses)Premium Member (Silver)The Steel CurtainI use FirefoxI use Google ChromeI use Internet ExplorerI use SafariI'm Here To Help, & Have Proven It!Windows UserMember of VileThe JokerSomeone thinks you're a Rotten Tomato!STaRDoGG <3's you ;)
Joined: 01/22/2009
Posts: 234
Drops: 350
Re: random sound app

Yea I didn't really want to get real mallicious with it.  But to learn it may not be a bad idea to write things like that. I do want to write a keylogger.  Not to tough to make a basic one.  Again just for learning purposes. I don't plan to launch new virus's out to the public. I spend to much time avoiding and trying to clean them to want to really be one of the Jerks putting them out there.  But anyway I thought maybe I'd package my bug as a gag type app for fun.  Disclaimer it and name it such. It dosn't do anything bad.  Just plays sounds. I do want to still mess with other more advance features like opening/closing CD rom.  Maybe flipping the dsiplay upsidown or something.  Will see.  But I wrote this app from scratch in 2 day's.  And that's just a few hours the first night and a few last night finishing it. It took me longer to do the counting of each event then it should of. I had the code right but I only made one var for int and it was casuing it to do weird things when all them were counting at once.  hahahah.  Live and learn.



I believe in making the world safe for our children, but not our children's children, Because I don't think children should be having sex.

Who's New

metaclippingpath's picture
Generalocee's picture
emma agro's picture
DarkkDdream's picture
Larisabrownb's picture
conor13's picture
MeadeDorianx's picture
Emilylowes's picture
Emmaythomson's picture
Chair's picture
Financial's picture
Red bud's picture
DonnaStella123's picture
WenrichFeugene's picture
Weissert's picture
facebook codes exploits tips tricks Phrozen Crew
All contents ©Copyright GeekDrop™ 2009-2024
TOS | Privacy Policy