|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libgnome/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>gnome-sound</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GNOME Library Reference Manual">
<link rel="up" href="ch01s04.html" title="Miscellaneous">
<link rel="prev" href="libgnome-gnome-util.html" title="gnome-util">
<link rel="next" href="libgnome-gnome-triggers.html" title="gnome-triggers">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="libgnome.html" title="GNOME Library (libgnome)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libgnome-gnome-util.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01s04.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME Library Reference Manual</th>
<td><a accesskey="n" href="libgnome-gnome-triggers.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2827349" class="shortcut">Top</a>
 | 
<a href="#id2827466" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libgnome-gnome-sound"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2827349"></a><span class="refentrytitle">gnome-sound</span>
</h2>
<p>gnome-sound — Sound playing routines.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <libgnome/libgnome.h>
void <a href="libgnome-gnome-sound.html#gnome-sound-init">gnome_sound_init</a> (const char *hostname);
void <a href="libgnome-gnome-sound.html#gnome-sound-shutdown">gnome_sound_shutdown</a> (void);
void <a href="libgnome-gnome-sound.html#gnome-sound-play">gnome_sound_play</a> (const char *filename);
int <a href="libgnome-gnome-sound.html#gnome-sound-sample-load">gnome_sound_sample_load</a> (const char *sample_name,
const char *filename);
int <a href="libgnome-gnome-sound.html#gnome-sound-connection-get">gnome_sound_connection_get</a> (void);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2827466"></a><h2>Description</h2>
<p>
This module provides wrapper functions for playing sound samples. Currently it
just wraps the esound daemon, but the API is flexible enough that other sound
infrastructures can be included in the future.
</p>
<p>
These functions also allow for the fact that no sound may be supported on the
current platform. So applications can safely call these functions to play
sounds and they will just quietly return if no action is possible.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2827491"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2827502"></a><h3>
<a name="gnome-sound-init"></a>gnome_sound_init ()</h3>
<a class="indexterm" name="id2827514"></a><pre class="programlisting">void gnome_sound_init (const char *hostname);</pre>
<p>
Initialize the esd connection.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> Hostname where esd daemon resides.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2827565"></a><h3>
<a name="gnome-sound-shutdown"></a>gnome_sound_shutdown ()</h3>
<a class="indexterm" name="id2827578"></a><pre class="programlisting">void gnome_sound_shutdown (void);</pre>
<p>
Shuts down the gnome sound support.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2827603"></a><h3>
<a name="gnome-sound-play"></a>gnome_sound_play ()</h3>
<a class="indexterm" name="id2827616"></a><pre class="programlisting">void gnome_sound_play (const char *filename);</pre>
<p>
Plays the audio stored in <em class="parameter"><code>filename</code></em>, if possible. Fail quietly if playing is
not possible (due to missing sound support or for other reasons).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
<td> File containing the sound sample.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2827674"></a><h3>
<a name="gnome-sound-sample-load"></a>gnome_sound_sample_load ()</h3>
<a class="indexterm" name="id2827687"></a><pre class="programlisting">int gnome_sound_sample_load (const char *sample_name,
const char *filename);</pre>
<p>
Loads the audio from <em class="parameter"><code>filename</code></em> and load it into the esd cache for later
playing. Programs will rarely want to call this function directly. Use
<a href="libgnome-gnome-sound.html#gnome-sound-play"><code class="function">gnome_sound_play()</code></a> instead for fire and forget sound playing.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>sample_name</code></em> :</span></td>
<td> The name of the sample.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
<td> The filename where the audio is stored.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The esound sample_id or <code class="literal">-1</code> if the sample was unable to be cached
for esound.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2827799"></a><h3>
<a name="gnome-sound-connection-get"></a>gnome_sound_connection_get ()</h3>
<a class="indexterm" name="id2827813"></a><pre class="programlisting">int gnome_sound_connection_get (void);</pre>
<p>
Rarely needed to by programs directly, this function may be useful if a
program has cached a sample with <a href="libgnome-gnome-sound.html#gnome-sound-sample-load"><code class="function">gnome_sound_sample_load()</code></a> and now wishes to
call <code class="function">esd_sample_play()</code> to play the sample.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the file descriptor of our esound connection or <code class="literal">-1</code>
on error.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>