"Georges" a écrit dans le message de news:c5k5h9$5hb$ > Salut à tous > Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en > VB6? Merci
Salut
J'ai déjà essayé mais l'APIBeep n'utilise pas la carte Son du PC et je
voudrai ecouter les sons avec ma carte Son.
"François Picalausa" <fpicalausa@chez.com> a écrit dans le message de news:
#PXMJAmIEHA.2720@TK2MSFTNGP11.phx.gbl...
Hello,
Tu peux regarder du côté de l'API Beep pour windows XP/2000
Sinon, il te faudra utiliser des APIs telles que waveOutWrite.
--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net
"Georges" <louisun27@wanadoo.fr> a écrit dans le message de
news:c5k5h9$5hb$1@news-reader3.wanadoo.fr
> Salut à tous
> Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en
> VB6? Merci
"Georges" a écrit dans le message de news:c5k5h9$5hb$ > Salut à tous > Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en > VB6? Merci
gee-dee-
Bonsoir, selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
sinon avec adaptation tu peux essayer cela !!! : ;-))) '----------------------- Private Type MIDIOUTCAPS wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * 32 wTechnology As Integer wVoices As Integer wNotes As Integer wChannelMask As Integer dwSupport As Long End Type Private Declare Function midiOutGetDevCaps Lib _ "winmm.dll" Alias "midiOutGetDevCapsA" (ByVal uDeviceID _ As Long, lpCaps As MIDIOUTCAPS, ByVal uSize As Long) As Long Private Declare Function midiOutGetNumDevs Lib "winmm" () As Integer
Private Declare Function MidiOutClose Lib "winmm.dll" _ Alias "midiOutClose" (ByVal hMidiOut As Long) As Long '------------------------------- Private Declare Function MidiOutOpen Lib "winmm.dll" _ Alias "midiOutOpen" (lphMidiOut As _ Long, ByVal uDeviceID As _ Long, ByVal dwCallback As _ Long, ByVal dwInstance As _ Long, ByVal dwFlags As Long) As Long '------------------------------- Private Declare Function MidiOutShortMsg Lib "winmm.dll" _ Alias "midiOutShortMsg" (ByVal hMidiOut As _ Long, ByVal dwMsg As Long) As Long '--------------------------------------------------- Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long) Dim hMidiOut As Long Public lanote As Integer
Sub samba() '----- proc originale de Sitting Hoax MPFE batterie = Array(48, 47, 56, 55) Randomize Application.EnableCancelKey = xlErrorHandler On Error GoTo fin For i = 1 To 250 Randomize x = batterie(Int(Rnd * 4)) MidiOutClose hMidiOut MidiOutOpen hMidiOut, 0, 1, 2, 0 xxx = CInt(x) For z = 1 To 15 On Error GoTo fin Randomize MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) Sleep (Rnd * 150 + 70) Next Sleep (150) For z = 1 To 10 For u = 1 To 5 Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 30, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (100) Next Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 20, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (Rnd * 200) Next For z = 1 To 10 Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 15, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (100) Next Next fin: MidiOutClose hMidiOut End Sub
"François Picalausa" a écrit dans le message de news:%
Hello,
Tu peux regarder du côté de l'API Beep pour windows XP/2000
Sinon, il te faudra utiliser des APIs telles que waveOutWrite.
"Georges" a écrit dans le message de news:c5k5h9$5hb$ > Salut à tous > Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en > VB6? Merci
Bonsoir,
selon la doc et exemple à Allapi.net
l'API Beep ne fonctionne que pour NT
sinon avec adaptation tu peux essayer cela !!! :
;-)))
'-----------------------
Private Type MIDIOUTCAPS
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * 32
wTechnology As Integer
wVoices As Integer
wNotes As Integer
wChannelMask As Integer
dwSupport As Long
End Type
Private Declare Function midiOutGetDevCaps Lib _
"winmm.dll" Alias "midiOutGetDevCapsA" (ByVal uDeviceID _
As Long, lpCaps As MIDIOUTCAPS, ByVal uSize As Long) As Long
Private Declare Function midiOutGetNumDevs Lib "winmm" () As Integer
Private Declare Function MidiOutClose Lib "winmm.dll" _
Alias "midiOutClose" (ByVal hMidiOut As Long) As Long
'-------------------------------
Private Declare Function MidiOutOpen Lib "winmm.dll" _
Alias "midiOutOpen" (lphMidiOut As _
Long, ByVal uDeviceID As _
Long, ByVal dwCallback As _
Long, ByVal dwInstance As _
Long, ByVal dwFlags As Long) As Long
'-------------------------------
Private Declare Function MidiOutShortMsg Lib "winmm.dll" _
Alias "midiOutShortMsg" (ByVal hMidiOut As _
Long, ByVal dwMsg As Long) As Long
'---------------------------------------------------
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Dim hMidiOut As Long
Public lanote As Integer
Sub samba()
'----- proc originale de Sitting Hoax MPFE
batterie = Array(48, 47, 56, 55)
Randomize
Application.EnableCancelKey = xlErrorHandler
On Error GoTo fin
For i = 1 To 250
Randomize
x = batterie(Int(Rnd * 4))
MidiOutClose hMidiOut
MidiOutOpen hMidiOut, 0, 1, 2, 0
xxx = CInt(x)
For z = 1 To 15
On Error GoTo fin
Randomize
MidiOutShortMsg hMidiOut, RGB(153, xxx, 127)
Sleep (Rnd * 150 + 70)
Next
Sleep (150)
For z = 1 To 10
For u = 1 To 5
Randomize
x = batterie(Int(Rnd * 4))
xxx = CInt(x)
MidiOutShortMsg hMidiOut, RGB(153, xxx, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 30, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127)
Sleep (100)
Next
Randomize
x = batterie(Int(Rnd * 4))
xxx = CInt(x)
MidiOutShortMsg hMidiOut, RGB(153, xxx, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 20, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127)
Sleep (Rnd * 200)
Next
For z = 1 To 10
Randomize
x = batterie(Int(Rnd * 4))
xxx = CInt(x)
MidiOutShortMsg hMidiOut, RGB(153, xxx, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 15, 127)
MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127)
Sleep (100)
Next
Next
fin:
MidiOutClose hMidiOut
End Sub
"François Picalausa" <fpicalausa@chez.com> a écrit dans le message de
news:%23PXMJAmIEHA.2720@TK2MSFTNGP11.phx.gbl...
Hello,
Tu peux regarder du côté de l'API Beep pour windows XP/2000
Sinon, il te faudra utiliser des APIs telles que waveOutWrite.
--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net
"Georges" <louisun27@wanadoo.fr> a écrit dans le message de
news:c5k5h9$5hb$1@news-reader3.wanadoo.fr
> Salut à tous
> Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en
> VB6? Merci
Bonsoir, selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
sinon avec adaptation tu peux essayer cela !!! : ;-))) '----------------------- Private Type MIDIOUTCAPS wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * 32 wTechnology As Integer wVoices As Integer wNotes As Integer wChannelMask As Integer dwSupport As Long End Type Private Declare Function midiOutGetDevCaps Lib _ "winmm.dll" Alias "midiOutGetDevCapsA" (ByVal uDeviceID _ As Long, lpCaps As MIDIOUTCAPS, ByVal uSize As Long) As Long Private Declare Function midiOutGetNumDevs Lib "winmm" () As Integer
Private Declare Function MidiOutClose Lib "winmm.dll" _ Alias "midiOutClose" (ByVal hMidiOut As Long) As Long '------------------------------- Private Declare Function MidiOutOpen Lib "winmm.dll" _ Alias "midiOutOpen" (lphMidiOut As _ Long, ByVal uDeviceID As _ Long, ByVal dwCallback As _ Long, ByVal dwInstance As _ Long, ByVal dwFlags As Long) As Long '------------------------------- Private Declare Function MidiOutShortMsg Lib "winmm.dll" _ Alias "midiOutShortMsg" (ByVal hMidiOut As _ Long, ByVal dwMsg As Long) As Long '--------------------------------------------------- Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long) Dim hMidiOut As Long Public lanote As Integer
Sub samba() '----- proc originale de Sitting Hoax MPFE batterie = Array(48, 47, 56, 55) Randomize Application.EnableCancelKey = xlErrorHandler On Error GoTo fin For i = 1 To 250 Randomize x = batterie(Int(Rnd * 4)) MidiOutClose hMidiOut MidiOutOpen hMidiOut, 0, 1, 2, 0 xxx = CInt(x) For z = 1 To 15 On Error GoTo fin Randomize MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) Sleep (Rnd * 150 + 70) Next Sleep (150) For z = 1 To 10 For u = 1 To 5 Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 30, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (100) Next Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 20, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (Rnd * 200) Next For z = 1 To 10 Randomize x = batterie(Int(Rnd * 4)) xxx = CInt(x) MidiOutShortMsg hMidiOut, RGB(153, xxx, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 1, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 15, 127) MidiOutShortMsg hMidiOut, RGB(153, xxx + 6, 127) Sleep (100) Next Next fin: MidiOutClose hMidiOut End Sub
"François Picalausa" a écrit dans le message de news:%
Hello,
Tu peux regarder du côté de l'API Beep pour windows XP/2000
Sinon, il te faudra utiliser des APIs telles que waveOutWrite.
"Georges" a écrit dans le message de news:c5k5h9$5hb$ > Salut à tous > Comment générer une fréquence Hz ou une octave (ex 1000K Hz ) en > VB6? Merci
François Picalausa
Hello,
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour après la MSDN online ;-) Et il dit: Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, and Windows 95. Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server. et pour les deux paramètre: Windows Me/98/95: The Beep function ignores this parameter.
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Hello,
selon la doc et exemple à Allapi.net
l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour après la MSDN online
;-)
Et il dit:
Client: Included in Windows XP, Windows 2000 Professional, Windows NT
Workstation, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT
Server.
et pour les deux paramètre: Windows Me/98/95: The Beep function ignores
this parameter.
Mais sinon, XP, ce n'est que NT 5.1 :-)
--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net
"gee-dee-" <nomail@nomail.com> a écrit dans le message de
news:e0%23k7kmIEHA.2948@TK2MSFTNGP11.phx.gbl
selon la doc et exemple à Allapi.net
l'API Beep ne fonctionne que pour NT
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour après la MSDN online ;-) Et il dit: Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, and Windows 95. Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server. et pour les deux paramètre: Windows Me/98/95: The Beep function ignores this parameter.
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Modeste
;-))) tout a fait d'accord François... hélas tout le monde ne dispose pas du SDK .... :-(
Sub test2() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: Dim Cnt As Long Dim Pas As Long Pas = 10 * (1 + Int(Rnd() * 100)) For Cnt = 0 To 5000 Step Pas 'play a tone of 'Cnt' hertz, for 50 milliseconds Beep Cnt, 50 'Application.StatusBar = Cnt DoEvents Next Cnt End Sub
@+
-----Message d'origine----- Hello,
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour
après la MSDN online
;-) Et il dit: Client: Included in Windows XP, Windows 2000
Professional, Windows NT
Workstation, Windows Me, Windows 98, and Windows 95. Server: Included in Windows Server 2003, Windows 2000
Server, and Windows NT
Server. et pour les deux paramètre: Windows Me/98/95: The Beep
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
.
;-)))
tout a fait d'accord François...
hélas tout le monde ne dispose pas du SDK .... :-(
Sub test2()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Cnt As Long
Dim Pas As Long
Pas = 10 * (1 + Int(Rnd() * 100))
For Cnt = 0 To 5000 Step Pas
'play a tone of 'Cnt' hertz, for 50 milliseconds
Beep Cnt, 50
'Application.StatusBar = Cnt
DoEvents
Next Cnt
End Sub
@+
-----Message d'origine-----
Hello,
selon la doc et exemple à Allapi.net
l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour
après la MSDN online
;-)
Et il dit:
Client: Included in Windows XP, Windows 2000
Professional, Windows NT
Workstation, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000
Server, and Windows NT
Server.
et pour les deux paramètre: Windows Me/98/95: The Beep
function ignores
this parameter.
Mais sinon, XP, ce n'est que NT 5.1 :-)
--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net
"gee-dee-" <nomail@nomail.com> a écrit dans le message de
news:e0%23k7kmIEHA.2948@TK2MSFTNGP11.phx.gbl
selon la doc et exemple à Allapi.net
l'API Beep ne fonctionne que pour NT
;-))) tout a fait d'accord François... hélas tout le monde ne dispose pas du SDK .... :-(
Sub test2() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: Dim Cnt As Long Dim Pas As Long Pas = 10 * (1 + Int(Rnd() * 100)) For Cnt = 0 To 5000 Step Pas 'play a tone of 'Cnt' hertz, for 50 milliseconds Beep Cnt, 50 'Application.StatusBar = Cnt DoEvents Next Cnt End Sub
@+
-----Message d'origine----- Hello,
selon la doc et exemple à Allapi.net l'API Beep ne fonctionne que pour NT
Le platform SDK est la source officielle la plus à jour
après la MSDN online
;-) Et il dit: Client: Included in Windows XP, Windows 2000
Professional, Windows NT
Workstation, Windows Me, Windows 98, and Windows 95. Server: Included in Windows Server 2003, Windows 2000
Server, and Windows NT
Server. et pour les deux paramètre: Windows Me/98/95: The Beep