Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Could not open sound file

mauro
Registered User
Quote
2016-02-10 00:23:13

Hi

I wrote a prohject in Visual C 2013, the projects build, but when I try to run it I get the followin console message:
***
irrKlang sound library version 1.5.0
Loaded plugin: ikpflac.dll
Loaded plugin: ikpmp3.dll
Using DirectSound8 driver
Could not open sound file: ophelia.mp3
Press any key to continue . . .
***

I am trying to play a single sound file, I herewith the Visual C code:

***
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IrrKlang;

namespace player5
{
class Program
{
[STAThread]
static void Main(string[] args)
{
// start the sound engine with default parameters
ISoundEngine engine = new ISoundEngine();

Console.Beep();
// To play a sound, we only to call play2D(). The second parameter
// tells the engine to play it looped.

engine.Play2D("ophelia.mp3");



}
}
}
***

This is my 1st try to write a program using Irrklang, I am not sure where to place the sound files to be played. Perhaps they should be where the .cs files are? Or where the .sln file is?

Why if the pluggings are well loaded, the file is not open?
What can I do?

Thanks


niko
Moderator
Quote
2016-02-10 03:52:34

Try copying the file to the debug and/or working directory, and see if it works then.


mauro
Registered User
Quote
2016-02-10 12:21:28

I

I copied the mp3 file to the following location: ..\player5App\player5\bin\x64\Debug

I modified the code like this:

***
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IrrKlang;

namespace player5
{
class Program
{
[STAThread]
static void Main(string[] args)
{
// start the sound engine with default parameters
ISoundEngine engine = new ISoundEngine();


// To play a sound, we only to call play2D(). The second parameter
// tells the engine to play it looped.

engine.Play2D("ophelia.mp3");
//engine.Play2D("beep.wav", true);
Console.Beep();
Console.Beep();
Console.Beep();



}
}
}
***

I got a pretty short play of the mp3, basicaly the same duration as the console beep. I repeated the console beep 3 times and I got a little longer playing; without the console beep in teh code I have no playing at all.


I ghot now this output:
***
irrKlang sound library version 1.5.0
Loaded plugin: ikpflac.dll
Loaded plugin: ikpmp3.dll
Using DirectSound8 driver
Press any key to continue . . .
***

I might understand that the code already got the file location, but, why it is not able to play it in a full duration?
Why it depends on the console beep?

I guess in my last message I left some incomplete info. I am writing this project in visual C(shart) 2013, running windows 7 X64. The IDE identify the dotnet framework 4.5.1.

any idea why is this working like that?

Thanks


Create reply:


Posted by: (you are not logged in)


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