I am an novice C# programmer. I am experimenting with GTK# and am trying to play audio on a button click with the Gnome.Sound.Play method. It will compile but not play audio. What is correct usage of the Gnome.Sound.Play method? <br>
<br>-------------------------------------------------------------------------------------<br>using Glade;<br>using Gtk;<br>using System;<br>using Gnome;<br><br>class myWindow<br>{&nbsp; // start class<br>&nbsp;&nbsp;&nbsp; public myWindow ()<br>
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; { // start mywindow<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Glade.XML gui = new Glade.XML (&quot;./test2/test2.glade&quot;,&quot;window1&quot;,&quot;&quot;); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gui.Autoconnect (this);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } // end mywindow<br><br>
&nbsp;&nbsp;&nbsp; void on_button_clicked (object o,EventArgs e) &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; { //start click event<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Console.WriteLine (&quot;button clicked&quot;)<br><b>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Gnome.Sound.Init (&quot;/home/user/test.wav&quot;); //&lt;--------is this correct?<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Gnome.Sound.Play (&quot;/home/user/test.wav&quot;); //&lt;--------is this correct?</b><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } //end click event<br><br>} // End class<br><br>class theotherpart<br><br>{&nbsp; // start class<br>&nbsp;static void Main ()<br>
&nbsp;&nbsp;&nbsp; { //start main<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Gtk.Application.Init ();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myWindow W = new myWindow ();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Gtk.Application.Run ();<br>&nbsp;&nbsp;&nbsp; } //End main<br>} // End class<br>