Read zip archives in IrrKlang
Read zip archives in IrrKlang
IrrKlang documentation says, that it is possible to read audio streams from zip files. But how to do that? I searched over the internet, but found no information. How can I load sounds from zip archive? Any ideas? Or maybe it isn't possible? If it is not possible then why does it says "irrKlang can read directly from compressed zip files, pak files, memory, and everywhere the Irrlicht Engine can" on the IrrKlang site.
P.S. IrrKlang directed me to this forum (I thought that it is IrrKlang's forum)
P.S. IrrKlang directed me to this forum (I thought that it is IrrKlang's forum)
OK then. Thisi is my code:
But what can I do with this IAudioStream object? How can I play the sound?
Code: Select all
IReadFile* pFile=m_pIrrlichtDevice->getFileSystem()->createAndOpenFile("Music/5_TUF.OGG");
IAudioStreamLoader* pLoader;
m_pIrrKlangDevice->registerAudioStreamLoader(pLoader);
IAudioStream* pStream=pLoader->createAudioStream(pFile);
I tryed everything. This forum has almost no information about IrrKlang and there ar no other tutorials than this short example on the internet. Does the author of IrrKlang come to this forum? Maybe he can help me?
Sorry for the late answer, take a look at this: http://www.ambiera.com/irrklang/tutoria ... ccess.html
You would only need the second block of code of that tutorial: in CMyFileFactory::createAndOpenFile, just return Irrlicht->getFileSystem()->createAndOpenFile(), and after starting up irrKlang add your file factory it using engine->addFileFactory(factory); like in the tutorial. In this way, irrKlang will use the file system of irrlicht.
You can also change the behavior and make irrklang only read special files using the Irrlicht Filesystem or whatever you like.
You would only need the second block of code of that tutorial: in CMyFileFactory::createAndOpenFile, just return Irrlicht->getFileSystem()->createAndOpenFile(), and after starting up irrKlang add your file factory it using engine->addFileFactory(factory); like in the tutorial. In this way, irrKlang will use the file system of irrlicht.
You can also change the behavior and make irrklang only read special files using the Irrlicht Filesystem or whatever you like.
Re: Read zip archives in IrrKlang
This is not thread safe when using streamed files.
Sometimes I'm having bad crashes using this.
Sometimes I'm having bad crashes using this.
CuteAlien wrote:coders are well-known creatures of the night