[maemo-developers] Unable to play audio file in Scratchbox
From: Pallavi Kandhare pallavi.kandhare at yahoo.comDate: Tue May 25 09:25:56 EEST 2010
- Previous message: N810, GPS and Java
- Next message: Unable to play audio file in Scratchbox
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I want to play an audio file in Scratchbox (Fremantle-X86) . Below is the code sample for the same. But this code doesnt work. When i checked the return value it displays the message "Not playing".
Can anybody tell me whats going wrong in the code.
Code:
#include <gst/gst.h>
int main( int argc, char* argv[] )
{
gst_init (&argc,&argv);
GstElement *player;
GMainLoop* loop;
loop = g_main_loop_new (NULL, FALSE);
player = gst_element_factory_make ("playbin", "player");
g_assert (player != NULL);
g_object_set (G_OBJECT (player), "uri", "/home/pallavi/MyDocs/.sounds/clip2.mp3", NULL);
int ret1 = gst_element_set_state (player, GST_STATE_PLAYING);
if(ret1 == GST_STATE_CHANGE_FAILURE )
g_print("\n Not Playing");
if(ret1 == GST_STATE_CHANGE_SUCCESS )
g_print("\n Playing");
g_main_loop_run(loop);
return 0;
}
Thanks.
- Previous message: N810, GPS and Java
- Next message: Unable to play audio file in Scratchbox
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
