GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 25, 2016 4:41 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GStreamer simple sound example
PostPosted: Sat Mar 10, 2012 3:01 pm 
Familiar Face

Joined: Fri Mar 09, 2012 3:08 am
Posts: 5
I'm writing a game in GTK+. Here is my other post with the game source attached.

I want to add sound to the game. Just some short "shoot" or "boom" sound + may be a background music.
I'm trying to use GStreamer for that and I found an example that makes GStreamer play an sound from a file given in this way:

The file comes from an command line argument, so it is easy to write "file://$PWD/file.ogg" if we need to play a file from the current directory. But what should I do in run-time? I think there should be a better way.

1) Do you know any simple examples of using GStreamer? Something like a function gst_just_simply_play_sound("file.ogg");
2) Is it possible to preload sounds and play them later?
3) Are there any more suitable libraries for this purpose?
4) What is the best format for the sound files? Is it OGG?

 Post subject: Re: GStreamer simple sound example
PostPosted: Sun Mar 11, 2012 1:42 am 
Never Seen the Sunlight

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 323
Location: Fortress of solitude
Maybe simplas as ca_gtk_play_for_widget

* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group