Download Horizon :: Staff Members :: Save Vault :: XboxMB YouTube


Old 03-05-2011   #1 (permalink)
Banned
 
Join Date: Nov 2010
Posts: 1,595
Thanks: 414
Default Music on Form1_Load?

Okay i know how to do it sorta, but when a user loads form1 i want it to play the .mp3 that i included in the .rar file they downloaded.

theres a few ways to do it, but i got confused. help?

thanks.


also, im playing music to entertain them
Reeve95 is offline


Old 03-05-2011   #2 (permalink)
Regular Member
austin12456's Avatar
Join Date: Jul 2010
Posts: 1,265
Thanks: 1,172
Default Re: Music on Form1_Load?

System.Media.SoundPlayer

__________________
austin12456 is offline
The following user thanked this post: Reeve95


Old 03-05-2011   #3 (permalink)
Banned
 
Join Date: Nov 2010
Posts: 1,595
Thanks: 414
Default Re: Music on Form1_Load?

Quote:
Originally Posted by SotG Caboose View Post
System.Media.SoundPlayer

System.Media.SoundPlayer("location")

but it could be C:\users\???\desktop/sound.mp3

like what do i do to get it to play? idk the path they have.. god tihs is confusing
Reeve95 is offline




Old 03-05-2011   #4 (permalink)
Haz
Regular Member
Haz's Avatar
Join Date: Sep 2010
Posts: 45
Thanks: 70
Default Re: Music on Form1_Load?

Quote:
Originally Posted by JR33V3 View Post
Okay i know how to do it sorta, but when a user loads form1 i want it to play the .mp3 that i included in the .rar file they downloaded.

theres a few ways to do it, but i got confused. help?

thanks.


also, im playing music to entertain them
My.Computer.Audio.Play(Location of File, AudioPlayMode.Background)
Haz is offline Send a message via AIM to Haz


Old 03-05-2011   #5 (permalink)
Banned
 
Join Date: Nov 2010
Posts: 1,595
Thanks: 414
Default Re: Music on Form1_Load?

Quote:
Originally Posted by Haz View Post
My.Computer.Audio.Play(Location of File, AudioPlayMode.Background) Must be .wav
how am i going to know the location of the file on THEIR PC though?
Reeve95 is offline


Old 03-05-2011   #6 (permalink)
Regular Member
austin12456's Avatar
Join Date: Jul 2010
Posts: 1,265
Thanks: 1,172
Default Re: Music on Form1_Load?

Code:
SoundPlayer player = new SoundPlayer(String.Format("{0}\\sounds\\sound1.wav", Application.StartupPath));

player.Play();
__________________
austin12456 is offline


Old 03-05-2011   #7 (permalink)
Haz
Regular Member
Haz's Avatar
Join Date: Sep 2010
Posts: 45
Thanks: 70
Default Re: Music on Form1_Load?

Quote:
Originally Posted by JR33V3 View Post
how am i going to know the location of the file on THEIR PC though?
add it to your Resources
code would look like this

My.Computer.Audio.Play(My.Resources.Name of song, AudioPlayMode.Background)
Haz is offline Send a message via AIM to Haz


Old 03-05-2011   #8 (permalink)
Banned
 
Join Date: Nov 2010
Posts: 1,595
Thanks: 414
Default Re: Music on Form1_Load?

Quote:
Originally Posted by SotG Caboose View Post
Code:
SoundPlayer player = new SoundPlayer(String.Format("{0}\\sounds\\sound1.wav", Application.StartupPath));

player.Play();
thanks. wanna convert it to VB?

unles this is correct.

Dim player As New SoundPlayer([String].Format("{0}\sounds\sound1.wav", Application.StartupPath))

player.Play()
Reeve95 is offline


Old 03-05-2011   #9 (permalink)
Banned
 
Join Date: Nov 2010
Posts: 1,595
Thanks: 414
Default Re: Music on Form1_Load?

all i had to do was add the .wav to my resources. thanks guys. close
Reeve95 is offline

Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:50 AM.


 

Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
COPYRIGHT (c) 2010 - 2013 - XboxMB - DESIGN BY:
EDENWEBS.COM