music not playing(SOLVED!!!!!!)thanks tropper,vitek,Acki,Mon
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
music not playing(SOLVED!!!!!!)thanks tropper,vitek,Acki,Mon
With the mixed smooth first and third person camera i added music into irrcameraRPG.cpp and i usually have problems but this time it worked! but no music is playing!
code:(omg the code button wont work,sorry!!)
#ifdef USE_AUDIERE
void CDemo::startAudiere()
{
audiereDevice = OpenDevice();
if (!audiereDevice)
return;
stream = OpenSound(audiereDevice.get(), "Intro.mp3", true);
if (!stream)
{
stream = OpenSound(audiereDevice.get(), "C:/Documents and Settings/Haouchars/Desktop/3d/media/Intro.mp3", true);
if (!stream)
return;
}
ballSound = OpenSound(audiereDevice.get(), "ball.wav", false);
if (!ballSound)
{
ballSound = OpenSound(audiereDevice.get(), "../../media/ball.wav", false);
}
impactSound = OpenSound(audiereDevice.get(), "impact.wav", false);
if (!impactSound)
{
impactSound = OpenSound(audiereDevice.get(), "../../media/impact.wav", false);
}
stream->setRepeat(true);
//stream->setVolume(0.5f); // 100% volume
stream->play();
}
#endif
#ifdef USE_SDL_MIXER
void CDemo::startSound()
{
stream = NULL;
ballSound = NULL;
impactSound = NULL;
SDL_Init(SDL_INIT_AUDIO);
if (Mix_OpenAudio(22050, AUDIO_S16, 2, 128))
return;
stream = Mix_LoadMUS("C:/Documents and Settings/Haouchars/Desktop/3d/media/Intro.mp3");
if (stream)
Mix_PlayMusic(stream, -1);
ballSound = Mix_LoadWAV("../../media/ball.wav");
impactSound = Mix_LoadWAV("../../media/impact.wav");
}
void CDemo::playSound(Mix_Chunk *sample)
{
if (sample)
Mix_PlayChannel(-1, sample, 0);
}
void CDemo::pollSound(void)
{
SDL_Event event;
while (SDL_PollEvent(&event))
;
}
#endif
This is from the irrlicht demo,i just copied it and changed 1 line of code to get my music. Whats with the NULL,it looks disabled?[/code]
code:(omg the code button wont work,sorry!!)
#ifdef USE_AUDIERE
void CDemo::startAudiere()
{
audiereDevice = OpenDevice();
if (!audiereDevice)
return;
stream = OpenSound(audiereDevice.get(), "Intro.mp3", true);
if (!stream)
{
stream = OpenSound(audiereDevice.get(), "C:/Documents and Settings/Haouchars/Desktop/3d/media/Intro.mp3", true);
if (!stream)
return;
}
ballSound = OpenSound(audiereDevice.get(), "ball.wav", false);
if (!ballSound)
{
ballSound = OpenSound(audiereDevice.get(), "../../media/ball.wav", false);
}
impactSound = OpenSound(audiereDevice.get(), "impact.wav", false);
if (!impactSound)
{
impactSound = OpenSound(audiereDevice.get(), "../../media/impact.wav", false);
}
stream->setRepeat(true);
//stream->setVolume(0.5f); // 100% volume
stream->play();
}
#endif
#ifdef USE_SDL_MIXER
void CDemo::startSound()
{
stream = NULL;
ballSound = NULL;
impactSound = NULL;
SDL_Init(SDL_INIT_AUDIO);
if (Mix_OpenAudio(22050, AUDIO_S16, 2, 128))
return;
stream = Mix_LoadMUS("C:/Documents and Settings/Haouchars/Desktop/3d/media/Intro.mp3");
if (stream)
Mix_PlayMusic(stream, -1);
ballSound = Mix_LoadWAV("../../media/ball.wav");
impactSound = Mix_LoadWAV("../../media/impact.wav");
}
void CDemo::playSound(Mix_Chunk *sample)
{
if (sample)
Mix_PlayChannel(-1, sample, 0);
}
void CDemo::pollSound(void)
{
SDL_Event event;
while (SDL_PollEvent(&event))
;
}
#endif
This is from the irrlicht demo,i just copied it and changed 1 line of code to get my music. Whats with the NULL,it looks disabled?[/code]
Last edited by a_haouchar on Thu Dec 28, 2006 12:23 am, edited 2 times in total.
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
sorry about double post, its just that post needs to be seperate from this post to look neater. anyway i have another problem, im trying to add a skybox in the engine aswell but i keep getting errors.
arrg the code button works now.
Code: Select all
// create sky box
//driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
scene::ISceneNode* skyboxNode;
skyboxNode = sm->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
// load music
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
here
so anybody can help with audio? tropper can you please send me a audio code so i can put it into the engine:)
Code: Select all
c:\documents and settings\haouchars\desktop\3d\irrcamerarpg\irrcamerarpg\irrcamerarpg.cpp(73) : error C2065: 'sm' : undeclared identifier
c:\documents and settings\haouchars\desktop\3d\irrcamerarpg\irrcamerarpg\irrcamerarpg.cpp(73) : error C2227: left of '->addSkyBoxSceneNode' must point to class/struct/union/generic type
type is ''unknown-type''
Hey good fella,
Happy Holiday
I would guess that "sm" should be "smgr" - assuming thats what your Scene Manager is, if you have kept the standard from through out the tutorials.a_haouchar wrote: c:\documents and settings\haouchars\desktop\3d\irrcamerarpg\irrcamerarpg\irrcamerarpg.cpp(73) : error C2065: 'sm' : undeclared identifier
Code: Select all
scene::ISceneNode* skyboxNode;
skyboxNode = smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
You scratch my back, I'll scratch yours.
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
yes
Code: Select all
#ifdef USE_AUDIERE
void CDemo::startAudiere()
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
Hey a_haouchar,
This is pretty much all you need to play audio with Audiere.
You just have to link to the lib and include, and place the audiere.dll in with your exe file.
Hope it helps
This is pretty much all you need to play audio with Audiere.
Code: Select all
#include "audiere.h"
using namespace audiere;
//in main
//initialize audio
AudioDevicePtr audiereDevice;
OutputStreamPtr stream;
audiereDevice = OpenDevice();
if (!audiereDevice)
return 1;
stream = OpenSound(audiereDevice.get(), "YOURSOUNDFILE.wav", true);
if (!stream)
return 2;
stream->setRepeat(true);
stream->setVolume(0.15f); // 15% volume
stream->play();
Hope it helps
You scratch my back, I'll scratch yours.
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne