I added/modified the following lines.
I get the following output.
/home/user/sound/sample.wav
GTK could not find a media module. Check your installation.
Why would GTK not be able to find the media modules on the system?
Code:
#define FILE_NAME_LENGTH 200void play( const char *name ){ char exeFile[FILE_NAME_LENGTH]; char soundFile[FILE_NAME_LENGTH]; GtkMediaStream *stream; strcpy( exeFile, "" ); if( readlink( "/proc/self/exe", exeFile, FILE_NAME_LENGTH ) != -1 ) { strcpy( soundFile, g_path_get_dirname( exeFile ) ); strcat( soundFile, "/" ); strcat( soundFile, name ); printf( "%s\n", soundFile ); stream = gtk_media_file_new_for_filename( soundFile ); printf( "%s\n", gtk_media_stream_get_error( stream )->message ); gtk_media_stream_set_volume( stream, 1.0 ); g_signal_connect( stream, "notify::ended", G_CALLBACK( ended ), NULL ); gtk_media_stream_play( stream ); }}
/home/user/sound/sample.wav
GTK could not find a media module. Check your installation.
Why would GTK not be able to find the media modules on the system?
Statistics: Posted by rp5_art — Mon Nov 04, 2024 2:22 am