It is currently Wed Jun 25, 2025 12:01 pm




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: for my nerds.
PostPosted: Tue Jan 31, 2012 7:12 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
hey I figured out how to make an awsome mouse over to trigger sounds, the possibilites could be endless for making website fake drum machines or whatever, I did this before but with sound manager, but that uses 6 trillion lines of code. this is simple, and I modified a code I found and made it cooler. you can test it here .

http://unsatisfiedpoets.net/experiments/Raindrop.htm

heres the code. easy as pie.

Code:
<audio id="audio1" src="biz.wav" >
</audio>
<audio id="audio2" src="biz2.wav" >
</audio>
<audio id="audio3" src="biz3.wav" >
</audio>
<script>
function Soundx(soundobj) {
  var thissound=document.getElementById(soundobj);
  thissound.play();
}
</script>
<form>
<input type="button" value="Play Sound" onMouseover="Soundx('audio1')">
</form>

<a href="#" onMouseover="Soundx('audio1')"> sound </a><br>

<a href="#" onMouseover="Soundx('audio2')"> sound 2</a><br>

<a href="#" onMouseover="Soundx('audio3')"> sound 3</a><br>



I know I claimed to invent mouse over sound last year, but this does Not use the sound manager library. only HTML5 and a teency weency javascript.

sorry for nerding out .

_________________
I/O - EHT - Evangelist.


Last edited by tape smoke on Tue Jan 31, 2012 7:54 am, edited 1 time in total.

Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Tue Jan 31, 2012 7:22 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
oh and I forgot, if you want it to play on a click just change onmouseover to onmouseclick, you can even set it up to hover and then click , by creating another player and a new class in your <a> tag. :D

_________________
I/O - EHT - Evangelist.


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 6:37 am 
Member
User avatar

Joined: Sat Apr 16, 2011 7:05 pm
Posts: 154
Location: Naptown
wysiwyg accomplishes this but its cool you wrote it out :D

_________________
http://soundcloud.com/mohzus


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 7:13 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
wysiwyg is killing me, something to do with unsanitized strings, and escaping them, which is beyond my level right now, so I hand code everything. Its funner and I like to validate everything. But sometimes, I sacrifice validity for easiness. ie using flash, blec

_________________
I/O - EHT - Evangelist.


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 7:39 am 
Member
User avatar

Joined: Sat Apr 16, 2011 7:05 pm
Posts: 154
Location: Naptown
what other languages are you working with? im in my last semester for computer programming. so far id say c++ and java are my tops but as far as .NET id choose c# over visual basic. Do you write in other scripting languages? I dont blame you for doing it by hand, its usually tidier that way.

_________________
http://soundcloud.com/mohzus


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 7:46 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
cool man im jelous you are working with real programming languages.

I only know what web development (html, css ) and a little bit of javascript and php. heres my design blog. http://crunkfu.cssdesign.info

I am going to attempt to make a sp 202 with this skeleton and some html5 audio attributes like loop and pause.

_________________
I/O - EHT - Evangelist.


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 7:57 am 
Member
User avatar

Joined: Sat Apr 16, 2011 7:05 pm
Posts: 154
Location: Naptown
really cool stuff. i can def. appreciate the work.
did you teach yourself the scripting?
ruby and python are really good languages as well for this kind of thing

_________________
http://soundcloud.com/mohzus


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 8:10 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
yeah, mostly self taught, got a little head start from being a computer tech in my early 20's and running into "hackers" here and there, I would always make them teach me everything they knew. which i would forget right away but yeah. haha, as for ruby and python, i am pretty much terrified of and have been putting off learning for the last year. but the time will come when I put on my big girl panties and learn some real shit.

_________________
I/O - EHT - Evangelist.


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 8:22 am 
Member
User avatar

Joined: Sat Apr 16, 2011 7:05 pm
Posts: 154
Location: Naptown
haha its really a matter of what works best for you imo
my favorite to toy around with is bash scripting
i use mostly linux so i try to write a bash script to do all my startup tasks ie: upgrade, update, clean, remove etc.
its an easy task but fun to automate things i guess.
good to see another geekster in the forums :mrgreen:

_________________
http://soundcloud.com/mohzus


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 8:23 am 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
for the non nerds. :lol:


Attachments:
SP202_IMG.jpg
SP202_IMG.jpg [ 225.57 KiB | Viewed 3795 times ]

_________________
I/O - EHT - Evangelist.
Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 8:42 am 
Member
User avatar

Joined: Sat Apr 16, 2011 7:05 pm
Posts: 154
Location: Naptown
awesomeness

_________________
http://soundcloud.com/mohzus


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 4:43 pm 
Member
User avatar

Joined: Thu May 12, 2011 4:14 am
Posts: 321
Location: southern ca
haha that pictures so badass

_________________
http://soundcloud.com/sleepyeyes


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 5:41 pm 
Member
User avatar

Joined: Sun Jan 04, 2009 9:43 pm
Posts: 7752
Location: France-Italy
how does the code works!?!?!
i stay still with Basic language, school me please

_________________
http://illtrovatore.bandcamp.com/
Youtube
http://www.myspace.com/illtrovatore


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 5:49 pm 
Member
User avatar

Joined: Thu Jun 10, 2010 8:38 pm
Posts: 429
Location: Rdg, PA
Very dope SP-202 graphic. I am definitely jacking that. Props to whoever created it.

_________________
Disciple of the Boom Bap.
Anti-Swag: Substance over Style.


Offline
 Profile  
Top 
 Post subject: Re: for my nerds.
PostPosted: Wed Feb 01, 2012 8:01 pm 
Funniest Member of the Year '09

Joined: Tue Jul 10, 2007 4:06 am
Posts: 1878
the code works like this,

here is a html5 audio player.

<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mpeg" />
</audio>


I removed the controls="controls" attribute. all this does is hide the audio player.

so the invisible player code now looks like this.

<audio id="audio1" src="biz.wav" >
</audio>


notice the audio ID . this is important to know what player to trigger.

ok.

function Soundx(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.play();
}


The javascript function will let the player be triggered by any DOM event.
( hover, click, mouse move, many others )

and then this just engages the script.

<a href="#" onMouseover="Soundx('audio1')"> sound </a>

this will work for a div, or any other DOM element or form. (button or whatever)

so actually the first code should have looked like this to keep it simple.
but i wanted to show multiple instances .


<audio id="audio1" src="sound.wav" >
</audio>
<script>
function Soundx(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.play();
}
</script>
<a href="#" onMouseover="Soundx('audio1')"> sound </a>

_________________
I/O - EHT - Evangelist.


Offline
 Profile  
Top 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 



Who is online

Users browsing this forum: No registered users and 35 guests


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 post attachments in this forum

Search for:
Jump to: