Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
[.Net] Sound doesn't get played.

vinzbad
Registered User
Quote
2013-01-22 12:27:19

Today I discovered IrrKlang and was quite impressed by the features and pricing. So I started trying it out, but I can't get the most simple thing to work: playback of a single .mp3

I'm incooperating IrrKlang in the Game-Class from the SharpDX-Toolkit.

In .LoadContent() I create the SoundEngine:

string file = @"../../Data/shock.mp3";
protected override void LoadContent()
{

engine = new ISoundEngine();

Console.WriteLine(file + " exists = " + File.Exists(file).ToString());]


As you can see I make sure, that the file exists, which I'm trying to load.

in the Update-Loop I check whether the sound gets played, and try to start it when it's not playing:


protected override void Update(GameTime gameTime)
{
if (!engine.IsCurrentlyPlaying(file))
{
//Console.WriteLine("Attempting to play: " + file);
engine.Play2D(file, true);
}
else Console.WriteLine("Sound gets played!");


The shock.mp3 is valid, I can play it via the VLC-Media-Player. I really don't know, why it's not playing.

What else can I test?

Thanks,
Vinz


erik
Registered User
Quote
2013-01-22 12:29:57

Did you look at the FAQ?
This is is maybe your problem: http://www.ambiera.com/irrklang/...

Playing back an mp3 doesn't work with my program using irrKlang, what did I do wrong?

If irrKlang doesn't play mp3s in your application, you probably forgot to copy the mp3 playback plugin to your application directory (The location where your .exe file is). The file is named ikpMP3.DLL in windows and ikpMP3.SO in Linux. Place it where irrKlang can find it (the current working directory or the place where your application binary is) and irrKlang will load the plugin and be able to play mp3s.



vinzbad
Registered User
Quote
2013-01-22 12:45:17

Yeah, thank you! This solved my problem, it would be cool if IrrKlang could throw an exception when attempting this without a plugin, it doesn't even check whether the file actually exists.

But anyways, I think I found the sound engine I needed for my games :)


Create reply:


Posted by: (you are not logged in)


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