Nirtec Studio Forum

General Category => Machines Simulator => Topic started by: jairo90 on September 07, 2023, 09:12:49 AM

Title: How could I play a sound from outside machine simulator library
Post by: jairo90 on September 07, 2023, 09:12:49 AM
Hi
Does Anybody knows how i could play a sound that is not in the machine simulator library sound?
Thanks in advance. 
Title: Re: How could I play a sound from outside machine simulator library
Post by: EasyPLC_Master on September 07, 2023, 06:10:17 PM
Very easy, use the function PlayExternalSound().

For instance add a Static Element and name it Stat, then use the same script code as listed here:

public void Init()
{
 
}

public void Main()
{
    if(IOManager.TrigOutUp(0))
        Stat.PlayExternalSound("D:\\Temp\\chord.wav");
}

public void Physics()
{

}

public void Finish()
{
 
}
Title: Re: How could I play a sound from outside machine simulator library
Post by: jairo90 on September 07, 2023, 11:41:01 PM
Thank you so much.  :)