Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Simple question, ISound

dudedduu
Registered User
Quote
2013-11-23 21:13:13

I'm kinda new to programming (c sharp), and I'm confused about how to make an instance of ISound and the likes. I cant seem to find answers.
http://www.ambiera.com/irrklang/docunet/index.html says i need to give it two arguments:
ISound* nativeSound,
ISoundEngine* nativeEngine
I get the ISoundEngine, but how am I supposed to give it an ISound, when that's what I'm trying to make to begin with?


erik
Registered User
Quote
2013-11-24 07:45:58

You don't create an ISound yourself, you get it back when you play a sound, using yourSoundEngine.Play2D(... or Play3D(...


chaz0
Registered User
Quote
2014-09-27 12:22:19

I actually have the same quandary here.

Ok, so ISound just makes use of ISoundEngine.

But how to create an instance of ISound in C, to use the Stop() method rather than ISoundEngine's StopAllSounds()?

The only example I've seen is ISound mySound = engine.Play2D(fileName, false);

but that's not much use when trying to use mySound.Stop() out of context.... It's not like I can create an instance of ISound separately and pass it around?

It's probably something simple, but I'm new to programming too, any help at all would be appreciated :-)


erik
Registered User
Quote
2014-09-27 20:03:27

It's really not that difficult. Here you have your instance of ISound, it is stored in a variable named 'sound':

ISound sound = engine.Play2D("someFilename.mp3");


Now, to stop that sound somewhere later, call stop to it:

sound.Stop();



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (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