Sounds playing in Silent profile (w/out modifying policy file which won't work in this case) require voodoo with PulseAudio and properties... If I figure it out, I'll post something up...
#include <gst/gst.h> #include <pulse/pulseaudio.h> #include <pulse/glib-mainloop.h> #define FDFDFDF "/home/user/MyDocs/.sounds/three 6 mafia - sippin on syrup pt 2 + camron, bun b, diplomats (hosted by bubba sparxxx).mp3" static GMainLoop *loop; static GstElement *sound_player, *pulsesink; int main (void) { gst_init(NULL, NULL); loop = g_main_loop_new (NULL, FALSE); //pa_glib_mainloop *pa_mainloop = pa_glib_mainloop_new (g_main_context_default ()); //pa_mainloop_api *pa_api = pa_glib_mainloop_get_api (pa_mainloop); pa_proplist *proplist = pa_proplist_new (); /* pa_proplist_sets (proplist, PA_PROP_APPLICATION_NAME, "maemo-applet-profiles"); pa_proplist_sets (proplist, PA_PROP_APPLICATION_ID, "org.maemo.HildonNotify"); pa_proplist_sets (proplist, PA_PROP_APPLICATION_VERSION, "0.50"); */ pa_proplist_sets (proplist, PA_PROP_EVENT_ID, "ringtone-preview"); pa_proplist_sets (proplist, "module-stream-restore.id", "x-maemo-applet-profiles"); //pa_context *pa_context = pa_context_new_with_proplist (pa_api, NULL, proplist); //pa_context_connect (pa_context, NULL, (pa_context_flags_t) PA_CONTEXT_NOFAIL, NULL); sound_player = gst_element_factory_make("playbin2", "Media Player"); pulsesink = gst_element_factory_make ("pulsesink", NULL); g_object_set (G_OBJECT (pulsesink), "proplist", proplist, NULL); g_printerr ("%s\n", G_STRLOC); //pa_proplist_free (proplist); g_object_set(sound_player, "audio-sink", pulsesink, "uri", g_filename_to_uri(FDFDFDF, NULL, NULL), NULL); gst_element_set_state(sound_player, GST_STATE_NULL); gst_element_set_state(sound_player, GST_STATE_PLAYING); g_timeout_add_seconds (10, (GSourceFunc) g_main_loop_quit, loop); g_main_loop_run (loop); return 0; }