Login to reply

3 posts


by cpeterlotz 8 months ago
Korduene version: 0.92.1230.2142 ALPHA
Windows version: Windows 10 Pro 1709 Build 16299.248
The Pause method for the audio player appears to be non-functional, due to the way the Play method is implemented. (Note that this also affects behavios when using an attached TrackBar.)
The problem is that the play method for the audio player object calls a file open and then a play;

private void Button1_Click(object sender, System.EventArgs e)
{
_023da53a58024a76bd7985910e9cfca1 = e;
_ff449481520047879974f7fec831ed22.Open(new Uri(@"c:\sound.wav"));
_ff449481520047879974f7fec831ed22.MediaEnded += delegate (object os, EventArgs ea) { };
_ff449481520047879974f7fec831ed22.Play();
}

For the purposes of simply playing an audio clip, this works well, However, when a clip is paused restrarting it is accomplished by simply issuing a play command to Windows Media Player- which is not possible. Instead, the clip is reopened and then plays from the beginning.

Would it be possible to add a "Resume" method, that would simply issue the play, without the file open? (There are other ways to address the issue, but this seems to be the least invasive, as it does not alther the existing implementation.

Thank You


cpeterlotz
by cpeterlotz 8 months ago
I am very glad that I discovered the Modify and Run option!

I created a small application, with three buttons all connected to the Play method- I then edited the code prior to compile. This allowed the Load and Play actions to be separated, while still retaining the existing Load+Play. Once complied, the resulting behaviors were expected- an audio file can be loaded with or without immediately playing.

[Q]
private void OpenButton_Click(object sender, System.EventArgs e)
{
_b1afa0ad29d04a71930028e2f2c2b031 = e;
_ad3c9db1b606460cb5056f2f06ecc8b1.Open(new Uri(_15aa30cb248c4a5a9e5b2242529bb3f0));
_ad3c9db1b606460cb5056f2f06ecc8b1.MediaEnded += delegate (object os, EventArgs ea) { };
}
private void OpenPlayButton_Click(object sender, System.EventArgs e)
{
_04a5bd3dbfb247798d105fcc6ed1d72f = e;
_ad3c9db1b606460cb5056f2f06ecc8b1.Open(new Uri(_15aa30cb248c4a5a9e5b2242529bb3f0));
_ad3c9db1b606460cb5056f2f06ecc8b1.MediaEnded += delegate (object os, EventArgs ea) { };
_ad3c9db1b606460cb5056f2f06ecc8b1.Play();
}
private void PlayButton_Click(object sender, System.EventArgs e)
{
_ea182f35846c46a5a815fc017786f2eb = e;
_ad3c9db1b606460cb5056f2f06ecc8b1.Play();
}
private void PauseButton_Click(object sender, System.EventArgs e)
{
_5e92a3dc55c143c99807e93c13097a41 = e;
_ad3c9db1b606460cb5056f2f06ecc8b1.Pause();
}
private void StopButton_Click(object sender, System.EventArgs e)
{
_5fa7fac883fc46d6ae99972366a0b050 = e;
_ad3c9db1b606460cb5056f2f06ecc8b1.Stop();
}
[/Q]

cpeterlotz
by Rebin 8 months ago
Hi,

Apologies for the late reply.
I've updated the AudioPlayer node, to separate open and play, now you can call open then after call play.
You will need to remove the node and add it again.

Kind regards,
Rebin

Korduene Developer
Login to reply
;