Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
a little bit confused

vandenhayes
Registered User
Quote
2007-07-12 14:28:12

i use IrrKlang at first to program a musicplayer.
everything is fine .. i have 2 players inside the program, set volume is also okay.

but i am absolutely confused how to use a function from ISound.
i wanna use the Playbackspeed function. so i have use a trackbar to regulate the speed .. but :



        ISoundEngine engine1 = new ISoundEngine();
        ISoundEngine engine2 = new ISoundEngine();
        ISound speedcontrol1 = new ISound(); // <------- here is my fault :(



at first i am confused , why this feature is not implemented in the normal ISoundengine, because if i have a normal play or set volume control it`s like this :



    public void button1_Click(object sender, EventArgs e)
        {

            engine1.Play2D("song1.wav");


        }

        public void trackBar1_Scroll(object sender, EventArgs e)
        {
            trackBar1.SetRange(0, 50);
            a = trackBar1.Value;
            label2.Text = Convert.ToString(a);
            float b = (a / 50);
            label1.Text = Convert.ToString(b);
            engine1.SoundVolume = b;

          
        }


so i am wondering that there was no "ISoundEngine.speedcontrol" - function.

In your Documentation to use ISound is the following :


public ISound(
   ISound* nativeSound,
   ISoundEngine* nativeEngine
);

i am new to csharp ... and beat me , but i don`t know what i shall do , to use the speedcontrol feature :)

so if anyone could give me an example it would be fine

thx in advance




guest
Guest
Quote
2007-07-12 19:59:29

You only get an ISound object when calling one of the play() functions in ISoundEngine. You cannot create an ISound using new().


vandenhayes
Registered User
Quote
2007-07-12 20:37:04

the problem is as follows :



  public void button1_Click(object sender, EventArgs e)
        {

            ISound music1 = engine1.Play2D("song1.wav");
            
          

        }

        public void trackBar1_Scroll(object sender, EventArgs e)
        {
            trackBar1.SetRange(0, 50);
            a = trackBar1.Value;
            float b = (a / 50);
            labelVolume.Text = Convert.ToString(b);
            engine1.SoundVolume = b;
            
          
        }

        private void trackBar2_Scroll(object sender, EventArgs e)
        {
            trackBar2.SetRange(-20, 20);
            c = trackBar2.Value;
            float d = (c / 20);
            labelBalance.Text = Convert.ToString(d);
            ISound music1 = engine1.Play2D("song1.wav");  //<----- not possible , because existing above
           music1.pan = d;        
        }


if i choose another variable for the second function , maybe " music2" i have absolutely bad sounds with failures all around.
On the other side it`s not possible for me that music1 is available in each function, Like a "global Variable"
If i wanna use more than one function from ISound i have that Problem :(
            


vandenhayes
Registered User
Quote
2007-07-13 00:46:26

have fixed everything *juchhu :)

.... if someone wanna have the solution ... i would post it


henry
Guest
Quote
2014-01-06 13:20:07

I tried to use a different ISound object to play the second file. no fix.

Maybe this helps:

Die Laufzeit hat einen schwerwiegenden Fehler entdeckt. Fehleradresse: "0x67e6d2c6" in Thread "0x2618". Fehlercode: 0xc0000005. Bei diesem Fehler könnte es sich um ein Problem in der CLR oder in den unsicheren oder nicht verifizierbaren Teilen des Benutzercodes handeln. Übliche Ursachen dieses Bugs sind Marshallerfehler für COM-Interop oder PInvoke, die den Stapel beschädigen können.


henry
Guest
Quote
2014-01-06 13:23:12

what was the problem?


Create reply:


Posted by: (you are not logged in)


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