|
-
Mar 21st, 2002, 04:38 AM
#1
Thread Starter
New Member
How 2 play a sound through PC speaker?
IF any1 has N idea 'bout playing sounds through a PC speaker please post it or send mail.
thanks
-
Mar 21st, 2002, 08:11 AM
#2
VB Code:
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Function Play(uFlags As Long)
Dim Rc As Long
Rc = sndPlaySound(mFileName, uFlags)
End Function
Private Sub Form_Load()
mFileName = "C:\Windows\Media\hello.wav"
Play (uFlags)
DoEvents
End Sub
-
Mar 21st, 2002, 04:14 PM
#3
Good Ol' Platypus
Do you mean the INTERNAL speaker (PC Speaker) or the sound card's output port? That code will do the sound card one, but not the internal speaker.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 21st, 2002, 07:23 PM
#4
Don't you need to send sound through the card to get to the speaker?
-
Mar 21st, 2002, 07:31 PM
#5
Member
HELLO?!?!?!?!?!?!!!!
I think he already said PC SPEAKER!
all i know is
private sub cmd_butbeep
Beep
End sub
DAMN IM TOO BASIC.....
[]:::::::::::[];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/
Did you know that you can be your own grandpa?! It's really cool. . . . . .
------------------------------------------------
But I'm not. . . Im just Myself. . . . .
Not my own grandpa. . . . . .
I put on my own pants today. . . . .
Im so proud of myself. . . . . 
-
Mar 23rd, 2002, 02:15 AM
#6
Thread Starter
New Member
YES! I mean "PC SPEAKER".No sound cards ,no nothing.
About the 'Beep' command I tried it ,it just doesn't work.
Maybe if we put some more code in it?
-
Mar 23rd, 2002, 02:23 AM
#7
Thread Starter
New Member
SORRY Spyplayer.
Turns out you're right.I just couldn't hear my speaker.
And here's a tip:
for higher sounds alter N
for i= 1 to N
beep
next i
the higher N is the higher the beep is
-
Mar 24th, 2002, 09:37 AM
#8
Addicted Member
Why use a crappy loop?
Why not just use the API function, hell of a lot easier:
VB Code:
Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub cmdBeep_Click()
Beep 1000, 100
Beep 3500, 250
End Sub
You can make some really good tunes out of it. I made 'Twinkle Twinkle Little Start' once.
Who needs rhetorical questions anyway?
Bazza NET - The place you want to be!

-
Mar 25th, 2002, 05:13 AM
#9
Thread Starter
New Member
Yet,
these r not the sounds I've been looking for.
I apreciate the effort, but I'm looking more of a 'starting the computer' kind of beep.
-
Mar 25th, 2002, 07:05 AM
#10
Addicted Member
the beep is different on the different BIOS chips available and the different PC Speakers. Have a fiddle with the frequency and duration of the Beep.
Who needs rhetorical questions anyway?
Bazza NET - The place you want to be!

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|