[solved]Audiere SoundEffect-Class Problem

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
Lo_Ord
Posts: 12
Joined: Thu Apr 27, 2006 2:24 pm

[solved]Audiere SoundEffect-Class Problem

Post by Lo_Ord »

Hi!

When I was trying to implement a sound-function for a machinegun today, I encountered a little problem:

Audiere uses the Soundeffect-Class, to let you play one sound multiple times, so it's perfect for a machine-gun. However, when I try to compile my program, I get an error message :(

Here's the code-snippet:

Code: Select all

SoundEffect *mg = OpenSoundEffect(this->audioDevice, "../media/mg.wav", MULTIPLE);
and here's the error-message:
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'audiere::SoundEffectPtr' (or there is no acceptable conversion) c:\Misantrophy\SVN\source\AudiereManager.cpp
Every other audiere-function works fine, everything is included correctly, I only cannot use the Soundeffect-class

I also tried this (even if it should not be different from the code above):

Code: Select all

SoundEffectPtr mg(OpenSoundEffect(this->audioDevice, "../media/mg.wav", MULTIPLE);
Does anyone know what the problem could be?
Last edited by Lo_Ord on Tue Jun 27, 2006 9:55 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I think you should search for an Audiere forum...

But the second parameter should not be a string, it's a referenz to a SampleSource...

So check the documentation or header file !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
GueZt_Coders
Posts: 44
Joined: Tue Jan 17, 2006 4:04 am

Post by GueZt_Coders »

If you just want to play an audio file multiple time, why not just
just set it on loop. using ->OpenSound(... or setting your object audio
to ->SetRepeat(.. to true and issue ->Stop() on when your done.
Just part of irrlicht related project| CLEAR CODE NOTATIONS IS LARGELY SELF CODUMENTING!
Lo_Ord
Posts: 12
Joined: Thu Apr 27, 2006 2:24 pm

Post by Lo_Ord »

Acki wrote:I think you should search for an Audiere forum...

But the second parameter should not be a string, it's a referenz to a SampleSource...

So check the documentation or header file !!!
I actually solved the problem, I was trying to safe the soundeffect in an OutputStream pointer, which of course cannot work. Still strange, that VS 2005 - error pointed at the creation of the SoundEffect... Thx anyway.

OpenSoundEffect is overloaded, you can use a string actually.
GueZT_Coders wrote: If you just want to play an audio file multiple time, why not just
just set it on loop. using ->OpenSound(... or setting your object audio
to ->SetRepeat(.. to true and issue ->Stop() on when your done.
That was my first try, but it then waits until the playing is finished and then starts again... This doesn't work for our machine gun, since we are using an Ak-47 sound with an echo at the end, so the file plays over one second. And an ak-47 with a sound-firerate of over 1 second is bad *g*
Post Reply