GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 11:31 am

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 
Offline
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:
Code:
file:///home/user/full/path/to/file/file.ogg

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?


Top
 Profile  
 
 Post subject: Re: GStreamer simple sound example
PostPosted: Sun Mar 11, 2012 1:42 am 
Offline
GTK+ Guru

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 286
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.


Top
 Profile  
 
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: Google [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