[Gtk-sharp-list] Simple Audio Test - Gnome.Sound.Play method?

Brian Gryder bgryderclock at gmail.com
Sun Apr 20 17:20:27 EDT 2008


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?

-------------------------------------------------------------------------------------
using Glade;
using Gtk;
using System;
using Gnome;

class myWindow
{  // start class
    public myWindow ()

        { // start mywindow
        Glade.XML gui = new Glade.XML ("./test2/test2.glade","window1","");
        gui.Autoconnect (this);
        } // end mywindow

    void on_button_clicked (object o,EventArgs e)
        { //start click event
            Console.WriteLine ("button clicked")
*            Gnome.Sound.Init ("/home/user/test.wav"); //<--------is this
correct?
            Gnome.Sound.Play ("/home/user/test.wav"); //<--------is this
correct?*
        } //end click event

} // End class

class theotherpart

{  // start class
 static void Main ()
    { //start main
        Gtk.Application.Init ();
        myWindow W = new myWindow ();
        Gtk.Application.Run ();
    } //End main
} // End class
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080420/1d995b62/attachment.html 


More information about the Gtk-sharp-list mailing list