Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrXML
IrrXml / Irrklang Getnodename Inconsistency

rvm
Registered User
Quote
2012-04-03 16:37:34

Hello,

I will use IrrXml with Irrklang to load the song.

I use this code to load :

void CSound::Load_Song()
{
//Song ID = l'ordre du xml
int ID_Number = 0;

//Chargement XML
irr::io::IrrXMLReader *Xml = irr::io::createIrrXMLReader("sound.xml");
std::string File;
while(Xml && Xml->read())
{
switch(Xml->getNodeType())
{
case (irr::io::EXN_ELEMENT):
{
if(!strcmp("Son", Xml->getNodeName()))
{
File = Xml->getAttributeValue("file");
irrklang::ISoundSource *Song = m_SoundEngine->addSoundSourceFromFile(File.c_str());
plog->Write(File.c_str());
Sound_List[ID_Number]=Song;
}
ID_Number++;
break;
}
}
}
}

My fist xml look like :

<?xml version="1.0"?>
<sound>
<!--Ceci est la liste des fichiers sons utiliser par RhombiCube.-->
<Son ID="0" file="./media/Son/crier.wav" />
</sound>

I get : ./media/Son/crier.wav and it don't run.

My second xml :

<?xml version="1.0"?>
<sound>
<!--Ceci est la liste des fichiers sons utiliser par RhombiCube.-->
<Son ID="0" file='"./media/Son/crier.wav"' />
</sound>

I use the same code from before but I get : "./media/Son/crier.wav"
and it don't run.

How can I use the getAttributeValue with addSoundSourceFromFile ?

Thanks,
RVM


niko
Moderator
Quote
2012-08-08 07:56:56

Depends on your working directory, I guess. You are using a relative path, and it is relative to your current working directory.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact