![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#2
|
||||
|
||||
|
Hola Jusar.
Podés utilizar el componente TMediaPlayer. Por ejemplo: Código:
...
#include<mplayer.hpp>
#define MP3_FILE "C:\\Users\\User\\Music\\Sound.mp3" /* ruta+nombre_archivo */
TMediaPlayer *mp = new TMediaPlayer(Form1);
void __fastcall TForm1::FormCreate(TObject *Sender)
{
mp->Parent = this;
mp->Visible = false;
mp->FileName = MP3_FILE;
mp->AutoRewind = true;
mp->AutoOpen = true;
mp->OnNotify = MediaPlayerNotify;
mp->Open();
mp->Play();
}
void __fastcall TForm1::MediaPlayerNotify(TObject *Sender)
{
if (mp->NotifyValue == nvSuccessful ){
mp->Play();
mp->Notify = true;
}
}
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
mp->Close();
delete mp;
}
Código:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
MediaPlayer1->Open();
MediaPlayer1->Play();
}
void __fastcall TForm1::MediaPlayer1Notify(TObject *Sender)
{
if (MediaPlayer1->NotifyValue == nvSuccessful ){
MediaPlayer1->Play();
MediaPlayer1->Notify = true;
}
}
Un saludo.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 19-03-2012 a las 22:45:58. |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Cómo cargar archivo .txt en memo | onomatopeya | C++ Builder | 3 | 25-11-2007 13:23:28 |
| como cargar una matriz 4x4 con datos de un archivo ? | Picketero | C++ Builder | 1 | 20-04-2006 20:49:45 |
| Cómo cargar un archivo de ayuda *.hlp en c++ builder 6.0? | jcfc | C++ Builder | 0 | 01-06-2005 13:18:53 |
| Como Cargar Archivo Plano | mauroacev | Conexión con bases de datos | 3 | 17-03-2005 22:43:13 |
| Como cargar un archivo en aplicacion con D5 | jmedina | Varios | 2 | 22-11-2004 15:23:30 |
|