Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-05-2005, 06:44 PM   #1
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Post Play Sound

Hi,
Im doing a project that needs sound, how do I make a sound file play when the form is loaded.

PLease, please help!!!

Thanks
__________________

__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 03-17-2005, 01:24 PM   #2
The Candyman
 
~mr mixx~'s Avatar
 
Join Date: Jun 2004
Location: USA
Posts: 11,310
Default Re: Play Sound

well i think if you want a responce you'll have to give us more details. what kind of sound file are you trying to make/ what OS are you running/ what is it for.
__________________

__________________
" Let the music move you "
~mr mixx~ is offline   Reply With Quote
Old 03-17-2005, 04:11 PM   #3
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default

ive got XP home and im trying to make a .wav file play on a program that is kinda like who wants to be a millionaire, for a school project. Ive managed to get the toolbar sound player linked to the sound i want to play but i don't know the command to get the thing to play, ive looked on the internet but can't find any webs sites that can give a really simple answer that i can understand
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 03-22-2005, 10:49 AM   #4
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: Play Sound

its in VB, PLEASE HELP, anyone..... heeeeeeeeeeeelllllllllllllllllllppppppppppp (echo goes here)
__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Old 03-26-2005, 01:03 PM   #5
The Candyman
 
~mr mixx~'s Avatar
 
Join Date: Jun 2004
Location: USA
Posts: 11,310
Default Re: Play Sound

Well you couls use the sound editer in windows, but it it limited to to 2 minutes.

So i would suggest a google search for Sound Recorder and d/l a free version. the shareware ones

can cost anywhere from $20 bucks to $100
hundreds depending on the featutes and quality.

i fould one on the net that cost only $15 bucks & it let me record any sound coming out of my pc speaker's & turn it into a .wav/ .wma/ or .mp3 file.
__________________
" Let the music move you "
~mr mixx~ is offline   Reply With Quote
Old 04-02-2005, 12:49 AM   #6
Beta Member
 
Join Date: Dec 2004
Posts: 5
Default

hi Techy Geek,
dunno wut VB u r using!, but here s a piece of code for VB.NET that would help..

Code:
'Play Sound
    Private Declare Function PlaySound Lib "winmm.dll" (ByVal data() As Byte, _
      ByVal hMod As IntPtr, ByVal hwFlags As Integer) As Integer
    Private Const SND_ASYNC As Integer = &H1        'Play asynchronously
    Private Const SND_MEMORY As Integer = &H4       'Play wav in memory

    'The .wav will be stored in this byte array
    Private Shared ClickSound As Byte()

    Shared Sub New()
        'Get running assembly name
        Dim NameSpc As String = _
    Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString()
        'Look for the button click sound in the resource stream.
        Dim SoundFile As String
        Dim WavStrm As IO.Stream = _
Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( _
NameSpc + "." + "DRIVEBY.WAV")
        'ReDim the byte array to be the size of the embedded .wav
        ReDim ClickSound(CType(WavStrm.Length, Integer))
        'Load the .wav from the stream into the byte array
        WavStrm.Read(ClickSound, 0, Int(CType(WavStrm.Length, Integer)))
    End Sub
and where u need to play the sound u need to do this:
Code:
Call PlayWav(ClickSound)
hope this would b useful...
gurlie is offline   Reply With Quote
Old 04-09-2005, 07:52 PM   #7
Daemon Poster
 
Techy Geek's Avatar
 
Join Date: Feb 2005
Posts: 1,320
Send a message via MSN to Techy Geek
Default Re: Play Sound

its very good, but i dont really understand it, can u please guide me through, im not all that good at VB to be perfectly honest, also is that there the one where when playing the sound it stops all other processes until the sound has finished, or the one where the program can continue anyway

thanx
not so techy geek
__________________

__________________
"If I seem to act unkind, its only me and not my mind" I Want To Tell You, The Beatles, Revolver
"When I am king, you will be first against the wall" Paranoid Android, Radiohead, OK Computer
There are two types of people, those who hate Microsoft, and those who work for it...
Possibly a Mac Convert
Techy Geek is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off



All times are GMT -5. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0