Audiere problems

Discussion about everything. New games, 3d math, development tips...
Post Reply
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Audiere problems

Post by MikeR »

Can anyone point me to a good tut to get audiere going?
I tried the tut that comes with audiere, but get a whole bunch of syntax errors. (I copy/pasted his code)
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

what do you want it for? Simple background music or positional 3d audio?

I can give you a hand with simple background music:

Code: Select all

/AFC 3d level using The Irrlicht 3d engine compiling with MSVC toolkit 2003
//Copyright © 2004 Alvaro F. Celis "afecelis"
//-----------------------------------------------------------------------------------------------//
	#include <irrlicht.h>
	#include <audiere.h>
	#include <stdio.h>
	#include <windows.h> 	

	using namespace irr;
	using namespace audiere; 
	using namespace core;
	using namespace scene;
	using namespace video;
	using namespace io;
	using namespace gui;

	#pragma comment(lib, "Irrlicht.lib")
	#pragma comment (lib, "audiere.lib") 

//-----------------------------------------------------------------------------------------------//	
	int main()
	{
		IrrlichtDevice *device = 0;
		device = createDevice(video:: EDT_OPENGL , core::dimension2d<s32>(800, 600), 32, false,false,false,0);
		
//-----------------------------------------------------------------------------------------------//
	//initialize audio

	AudioDevicePtr audiereDevice;
	 OutputStreamPtr stream;

	 audiereDevice = OpenDevice();
	 if (!audiereDevice)
	  return 1;

	 stream = OpenSound(audiereDevice.get(), "./data/song3.mp3", true);
	 if (!stream)
	  return 2;

	 stream->setRepeat(true);
	 stream->setVolume(1.0f); // 50% volume
	 stream->play(); 
//--------------------------------------------------
etc etc etc

Now, if you get 3d positional audio to work please let me know (it's what I've always wanted to get working in Irrlicht) :D
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

I am going to go bald. :?

In my main.cpp I put the following:

Code: Select all

#include <irrlicht.h>
#include <iostream>
#include <audiere.h>
#include <windows.h>
#include <stdio.h>

using namespace irr;
using namespace gui;
using namespace audiere;

#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "audiere.lib") 
and after "int main"


Code: Select all

 //initialize audio 

   AudioDevicePtr audiereDevice; 
    OutputStreamPtr stream; 

    audiereDevice = OpenDevice(); 
    if (!audiereDevice) 
     return 1; 

    stream = OpenSound(audiereDevice.get(), "IrrlichtTheme.mp3", true); 
    if (!stream) 
     return 2; 

    stream->setRepeat(true); 
    stream->setVolume(1.0f); // 50% volume 
    stream->play(); 
I get the following errors:
[Linker error] undefined reference to `_imp__AdrOpenDevice@8'
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
[Linker error] undefined reference to `_imp__AdrOpenSound@12'
I have dev-Cpp linked the the proper libs and folders, plus have the dll file and h in my main folder. (with the exe and main.cpp)
I don't get it.
:?
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

are you also using the paths to audiere's "include" and "lib" folder?

in other words, are you using audiere's source?


final word:
This worked with msvc, dunno with DEVC++, perhaps devc doesn't like windows.h?
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

afecelis wrote:are you also using the paths to audiere's "include" and "lib" folder?

in other words, are you using audiere's source?


final word:
This worked with msvc, dunno with DEVC++, perhaps devc doesn't like windows.h?
Yes, I'm using audieres include and lib folders. I also have audiere.h and audiere.dll in my folder. I added the windows.h and stidio.h files later out of desperation. :D
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
alelink
Posts: 52
Joined: Tue Jan 20, 2004 8:32 pm
Location: Italy
Contact:

Post by alelink »

hi,
are you usin' the Audiere Devcpp devpak?
maybe if you use the standard dll (for Microsoft VisualC++)
it give you that linker error.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

alelink is right!

you need a devc++ compiled dll first. For such task you'll need audiere's devpack.

the dll you're including in your app is MSVC's
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

hahaha, ok. I'll have to go look for it.
I messed up my code trying to figure it out, so will have to fix that too.
I did have it working in debug mode for a bit tho. :)
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

Ok, there isn't a compile for dev-Cpp. Just win32
I fixed my code again and got it almost working. (it won't display the irrlicht logo anymore) and have sound, but still, only in debug mode.
No errors, nothing. I'm lost.

edit to add:
I think I found my problem. I had installed vc2005 beta. It converted all my files to it's own format. I now get to start my project over from scratch. :(
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

you'd better, same happened to me when I was playing around with that beta. And if an update comes out, don't install it; it will screw things even worse.

I'd say you should try the MSVCtoolkit2003, MS free C++ compiler, pro version of MSVC7:
http://www.microsoft.com/downloads/deta ... laylang=en

and use Codeblocks as IDE which detects it automatically:
http://www.codeblocks.org/

It compiles Irrlicht-NX apps no problem; still haven't tried to compile the dll.

But it's pretty easy to add include and lib folders with it.
:D
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

I uninstalled it. I won't go back to vc. I'll stick with Dev-Cpp.
At least I am very early in my app. I don't have much to redo. :D
Learning as I go.
Thanks for your help. At least now I know how to get it to work.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Murphy Needs His Password

Post by Murphy Needs His Password »

The DLL that is installed by the Audiere DevPak works. I haven't really looked at Audiere for a long time, but I'm pretty sure it's a straight C API, which generally means the DLL will work with any compiler. It only gets really difficult to share when you're working with C++. :)

Code: Select all

#pragma comment(lib, "Irrlicht.lib") 
#pragma comment(lib, "audiere.lib") 
I don't think GCC supports this pragma. I think you need to explicitly link to the libs in the Project Options dialog box. Or maybe you just need to set the proper lib directories in Project Options.

I got Audiere working with Dev-Cpp a few days ago using the Audiere DevPak. I posted about it in this thread.

Hope some of that helps.


Sidenotes:
MSVC Toolkit 2003 is very cool if you don't have Visual C++ or if you have the Standard version of VC++ 2003.

Codeblocks looks pretty good. I downloaded it a couple weeks ago and was going to evaluate it to see if I could recommend it to people, but then everthing went to hell. You like it, afecelis?
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

Thanks Murphy.
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "audiere.lib")
are needed, even tho I linked the libraries in the compiler.
I got this to work simply by uninstalling VC2005 and redownloading everything. My code is identicle to what I had before, but it works this time. :)
Thanks guys for your help. It is much appreciated. :)
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Post Reply