• Iniciar sesión
  • Microsoft.com
  • España (Español)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)France (Français)Italia (Italiano)United States (English)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Microsoft Developer Network
 
 
Inicio
 
 
Library
 
 
Aprendizaje
 
 
Descarga
 
 
Soporte
 
 
Comunidad
 
 
Foros
 
 
 
Microsoft Developer Network > Página principal de foros > Visual Basic General > Visual basic 2005 sound midi mp3 or wav files?
Formular una preguntaFormular una pregunta
Búsqueda de foros:
  • Buscar en el foro de Visual Basic General Buscar en el foro de Visual Basic General
  • Buscar en todos los foros de MSDN Buscar en todos los foros de MSDN
 

RespondidaVisual basic 2005 sound midi mp3 or wav files?

  • lunes, 23 de junio de 2008 19:17turkeygizzard Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0
    How would I incorporate sound into a program? For instance a starting form then within the body of the program? Would I need to use a timer or is a midi file usable as it is? 
    • ResponderResponder
    • CitarCitar
     

Respuestas

  • sábado, 28 de junio de 2008 10:07John Anthony Oliver Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     RespondidaTiene código
    Votar como útil
    0
    Hi,

    This is how to play WAVE *.wav files.

    Choose between;

    My.Computer.Audio.Play(ofd.FileName, AudioPlayMode.Background)

    or

    My.Computer.Audio.Play(ofd.FileName, AudioPlayMode.BackgroundLoop)

    or

    My.Computer.Audio.Play(ofd.FileName, AudioPlayMode.WaitToComplete)


    This works with Windows XP. :-) ;-)

    I'm not sure if VISTA still has a media folder containing WAVE files.

    Add 1 button to a FORM to try this code please.

    ofd.FileName here is the full path and filename returned from the OpenFileDialog.







    Option Strict On

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim ofd As New OpenFileDialog
    ofd.InitialDirectory = "C:\Windows\media"
    ofd.Filter = "Wave files only|*.wav"
    Try
    ofd.ShowDialog()

    My.Computer.Audio.Play(ofd.FileName, AudioPlayMode.Background)

    Catch ex As Exception
    MessageBox.Show(ex.ToString)
    End Try

    End Sub
    End Class





    Regards,

    John

    • Marcado como respuestaturkeygizzard sábado, 28 de junio de 2008 18:14
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 10:10Added an explanation.
    •  
    • ResponderResponder
    • CitarCitar
     

Todas las respuestas

  • sábado, 28 de junio de 2008 8:48Bingo_HB Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0

    Hallo

    bin gerade selbst auf der Suche, hab dabei diese Seite gefunden:

     http://msdn.microsoft.com/de-de/library/bb978298.aspx


    Mal sehen, ob ich die Beispiele (auf den Nachbarseiten) anwenden kann.

    Gruß
    Bingo_hb

    • ResponderResponder
    • CitarCitar
     
  • sábado, 28 de junio de 2008 9:23John Anthony Oliver Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0
    Hi ALL,

    Here is a rough translation of the above using  http://www.freetranslation.com/ >>>>


    ___________________________________________________
    Hello Am just even on the search, found at the same time this side: http://msdn.microsoft.com/de-de/library/bb978298.aspx

    See time whether I can use the examples (on the neighbor sides). Greeting Bingo_hb
    ___________________________________________________




    Regards,

    John

    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:24....
    •  
    • ResponderResponder
    • CitarCitar
     
  • sábado, 28 de junio de 2008 9:33John Anthony Oliver Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0
    Hi Microsoft staff,


    Can we have this article in ENGLISH please?

    I've tried.>>

    http://msdn.microsoft.com/en-us/library/bb978298.aspx

    and
    http://msdn.microsoft.com/en-gb/library/bb978298.aspx

    and

    http://msdn.microsoft.com/en-au/library/bb978298.aspx







    Regards,

    John


    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:36....
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:34....
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:40Deleted a bit of extraneous text.
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:33....
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:48Added another possible ENGLISH url link.
    • EditadoJohn Anthony Oliver sábado, 28 de junio de 2008 9:39....
    •  
    • ResponderResponder
    • CitarCitar
     
  • sábado, 28 de junio de 2008 18:11turkeygizzard Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0
    danke shein

    I only know how to spaek a few words in German.  Thankyou for your help but I wasn't able to view the library yet.  Thanks anyway I appreciate all the help I can get!!!


    ~turkey~
    • ResponderResponder
    • CitarCitar
     
  • sábado, 28 de junio de 2008 18:13turkeygizzard Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Votar como útil
    0
    Thankyou John I appreciate your help.  I'm really interested in midi files right now.  I will look at the url you gave but it has to be in English!!! Thankyou so much for your help.


    ~turkey~
    • ResponderResponder
    • CitarCitar
     
¿Necesita ayuda con los foros? (P+F)
 
© 2009 Microsoft Corporation. Reservados todos los derechos.
Administre su perfil
|
MSDN Flash en Español
|
Contacto
|
Aviso legal
|
Términos de uso
|
Marcas Registradas
|
Privacidad