Hello everyone,,,,Could you pls help me on how to play music in wxWidgets using the wxSound for i am having trouble in playing music/sound...
my constructor is like this......
wxSound *mySound = new wxSound (_T("hello.wav"), false );
and i put this into my frame and yet the music does'nt play...I dont have any error in compiling my program it just that the music doesnt played...
I hope you could help me most especialy those who have encountered the same problem like this one........
Thanks in advanced......salamat!!!!
playing sounds usig the wxSounds Topic is solved
-
- Knows some wx things
- Posts: 29
- Joined: Wed May 09, 2007 1:01 am
- Location: Manila,Philippines
- Contact:
playing sounds usig the wxSounds
What important in a problem is not the solution but the lessons you learned in finding the solution.
yeah, make sure hello is in the project file, in the folder with your cpp and.h files,
heres some code that works,
wxSound *mySound;
mySound = new wxSound(_T("kick.wav"), false);
mySound->Play();
you can also use the bool IsOk() function
if (mySound->IsOk())
{
mySound->Play();
}
also, try it like this, just incase you miss the first one or somthing,
mySound->Play();
you can also use the bool IsOk() function
if (mySound->IsOk())
{
mySound->Play(wxSOUND_ASYNC | wxSOUND_LOOP);
}
and finally make sure the .wav is named correctly and is in fact a ,wav file,
heres some code that works,
wxSound *mySound;
mySound = new wxSound(_T("kick.wav"), false);
mySound->Play();
you can also use the bool IsOk() function
if (mySound->IsOk())
{
mySound->Play();
}
also, try it like this, just incase you miss the first one or somthing,
mySound->Play();
you can also use the bool IsOk() function
if (mySound->IsOk())
{
mySound->Play(wxSOUND_ASYNC | wxSOUND_LOOP);
}
and finally make sure the .wav is named correctly and is in fact a ,wav file,
-
- Knows some wx things
- Posts: 29
- Joined: Wed May 09, 2007 1:01 am
- Location: Manila,Philippines
- Contact:
thanks to both of u
thanks to both of you tan and wforl....
I really appreciate your help
Thank you very much!!!!!
I really appreciate your help
Thank you very much!!!!!
What important in a problem is not the solution but the lessons you learned in finding the solution.