Programación General > Visual Basic 6.0 e inferiores

 Un Retardo Para Una Aplicacion

<< < (2/3) > >>

richard2348:
:hola: Gracias amigos voy a probar con sus ideas haber que sale :hola:
Saludos a todos

aTauRy:
Hola,
No se si te he entendido bien, quieres que cargue una figura y lance el sonido, cargue otra y lance el sonido y así hasta 5 figuras ¿no?

Si es así tras cargar la 1ª usa findwindowex (API) para saber si ha acabado y ejecuta el sonido, espera con un timer lo que dura el sonido y carga la segunda.
El control Timer también depende del equipo, si quieres segundos reales usa las API temporales.

Espero que te sirva, Hasta Otra ;)

richard2348:
:hola:Hola aTauRy haz dado en el clavo es justo lo que quiero, pero haber si me ayudas con esas apis no las conozco. Te agradeceria bastante :hola:

Cyclop:
Mejor usa esto y te olvidas de todos esos problemas


--- Código: Text ---Private Const SND_APPLICATION = &H80         '  look for application specific associationPrivate Const SND_ALIAS = &H10000     '  name is a WIN.INI [sounds] entryPrivate Const SND_ALIAS_ID = &H110000    '  name is a WIN.INI [sounds] entry identifierPrivate Const SND_ASYNC = &H1         '  play asynchronouslyPrivate Const SND_FILENAME = &H20000     '  name is a file namePrivate Const SND_LOOP = &H8         '  loop the sound until next sndPlaySoundPrivate Const SND_MEMORY = &H4         '  lpszSoundName points to a memory filePrivate Const SND_NODEFAULT = &H2         '  silence not default, if sound not foundPrivate Const SND_NOSTOP = &H10        '  don't stop any currently playing soundPrivate Const SND_NOWAIT = &H2000      '  don't wait if the driver is busyPrivate Const SND_PURGE = &H40               '  purge non-static events for taskPrivate Const SND_RESOURCE = &H40004     '  name is a resource name or atomPrivate Const SND_SYNC = &H0         '  play synchronously (default)Private Declare Function PlaySound Lib &#34;winmm.dll&#34; Alias &#34;PlaySoundA&#34; (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As LongPrivate Sub Form_Load()    'KPD-Team 2000    'URL: http://www.allapi.net/    'E-Mail: KPDTeam@Allapi.net    PlaySound &#34;C:&#092;WINDOWS&#092;MEDIA&#092;TADA.WAV&#34;, ByVal 0&, SND_FILENAME Or SND_ASYNCEnd Sub  

richard2348:
:hola: Hola Cyclop lo que tengo es algo asi:
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_MEMORY = &H4
Private Const SND_LOOP = &H8
Private Const SND_NOSTOP = &H10
Private Const SND_SYNC = &H0

Public Sub PlaySound(strSoundFile As String)
    Call sndPlaySound(strSoundFile, SND_ASYNC)
End Sub

Private Sub Pausa()
Dim i As Long
For i = 0 To 1000000
Next
End Sub

Private Sub Mostrar_Imagenes()
PlaySound App.Path & "\sonido_1.wav"
Primera.Picture = imagen(A)
Pausa
PlaySound App.Path & "\sonido_2.wav"
Segunda.Picture = imagen(B)
Pausa
PlaySound App.Path & "\sonido_3.wav"
Tercera.Picture = imagen©
Pausa
PlaySound App.Path & "\sonido_4.wav"
Cuarta.Picture = imagen(D)
Pausa
PlaySound App.Path & "\sonido_5.wav"
Quinta.Picture = imagen(E)
Pausa
End Sub

Private Sub Form_Load()
Mostrar_Imagenes
End Sub

Esto funciona mas o menos ya que Pausa depende de la velocidad de la maquina donde instale el programa, tu codigo funciona tambien con Pausa antes de ejecutar otro sonido, probe con el timer pero corre mal; tambien use DoEvents (no se si bien) pero me genera otros errores en otras partes del programa. Voy a seguir tratando de otras formas haber si sale, ya les aviso. Gracias por todo

Navegación

[0] Índice de Mensajes

[#] Página Siguiente

[*] Página Anterior

Ir a la versión completa