sound

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
carnia

sound

Post by carnia »

hi...i'm new, you tell me how play a file wav in irrlicht. o spend me a example. thank you :oops:
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

Irrlicht is just a 3D graphics engine and thus has no sound component. If you want sound you have to use a sound API like Audiere, Fmod, Bass etc.
carnia

c

Post by carnia »

thank you, but i don't do it . you spend me an example as hello world whit sound :oops:
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Check out the tech demo, that has sound in it.
Image Image Image
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post by Amt0571 »

I also would like to know how to use Irrlicht with sound, but I've looked at the tech demo, and although I enabled sound, I don't hear anything (my soundcard works perfectly).
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Well, sound really isn't really part of Irrlicht.

I'd try sample code from the audiere site and try logging to find out why Audiere isn't working.
Crud, how do I do this again?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, this is not really Irrlicht related !!! :evil:
Choose what sound lib you want to use (Audiere, FMod, OpenAL, etc.), work through the tutorials and check for a related forum !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
carnia

Post by carnia »

why i don't hear anything from tech demo??????? :?:
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

try to use your debugger, sometimes it helps :D
we could not debug your application, we could give you only tips :shock:
carnia

Post by carnia »

I have not understood does not work :cry: :cry: :cry:
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

sound has been deliberately removed from the techdemo since version 0.10 in order to reduce download size of the engine.

Now if you just want to play a background sound or music (wav or mp3) I'd suggest using audiere. So follow these simple steps:
1. Download audiere:
http://audiere.sourceforge.net/
2. Uncompress the SDK and link your IDE-compiler properly to audiere's "include" and "lib" folders. (caution, if you're using Devc++ you'll need to get audiere's Devpak via its update feature)
3. Use the following code:

Code: Select all

#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(); 
and finish your code for your app afterwards.
ps. Remember to place a copy of audiere.dll with your exe or you'll get errors.
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post by Amt0571 »

Wow! thanks! This is exactly the guide I was looking for :D
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

:D glad it helped :D
carnia

Post by carnia »

why there is that error :
[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
Guest

Post by Guest »

I tried it using DevC++, and downloading audiere via the update feature you mentioned.

I get the following errors and altough I've tried I don't manage to solve the problem:

[Linker error] undefined reference to `_imp__AdrOpenSound@12'
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
[Linker error] undefined reference to `_imp__AdrOpenDevice@8'
ld returned 1 exit status

Thanks :)
Post Reply