Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 04-10-2010
JerS JerS is offline
Miembro
 
Registrado: may 2005
Ubicación: Venezuela
Posts: 254
Poder: 22
JerS Va por buen camino
Cita:
Empezado por Neftali Ver Mensaje
He encontrado este código por Internet.
Ya te adelanto que no es mío y no lo he probado ya que en este equipo no dispongo del dispositivo adecuado.

Pruébalo y ya dirás...


Código Delphi [-]type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private TMS: TMemoryStream; wavOutDevice:Boolean; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses MMSystem; procedure TForm1.Button1Click(Sender: TObject); begin {in some procedure} if wavOutDevice then begin PlaySound(TMS.Memory, 0, SND_ASYNC or SND_MEMORY); end; //add 'or SND_LOOP' to loop it //if others, use tmsBells.Memory, etc. instead end; procedure TForm1.FormCreate(Sender: TObject); begin if WaveOutGetNumDevs = 0 then begin showmessage('No .wav output device available in your PC'); wavOutDevice := False; //global boolean variable end else begin TMS := TMemoryStream.Create; //use next line else where to load other .wav files when you need them TMS.LoadFromFile('.\ding.wav'); //may need a path like 'audio\music.wav' wavOutDevice := True; //global boolean var end; end; procedure TForm1.FormDestroy(Sender: TObject); begin //turn off any sound, use this else where to do same PlaySound(NIL, 0, SND_ASYNC or SND_NODEFAULT); TMS.Free; //free memory for other app's end; end.

Me imagino que aqui es donde selecciono que tarjeta de sonido deseo utilizar
Código Delphi [-]
   if WaveOutGetNumDevs = 0 then begin

esta bien el la selecciona pero siempre suena por la que esta por defecto, asi le cambie los valores al WaveOutGetDev en este hilo http://www.clubdelphi.com/foros/show...oducir+sonidos hablan sobre el WaveOutOpen pero de verdad que no tengo ni idea de como se utiliza
__________________
La vida es un simple pero complejo If

J=rS
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 11:51:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi