The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Gnome::Sound - Perl extension for libgnome/gnome-sound (GNOME 1.x)

SYNOPSIS

  use Gnome::Sound;
  use Gnome;

  Gnome->init($PACKAGE, $VERSION);

  Gnome::Sound::init($hostname);
  $sample_id = Gnome::Sound::sample_load($sample_name, $filename);
  Gnome::Sound::play($filename);
  Gnome::Sound::shutdown();

DESCRIPTION

This module is a Perl interface to gnome-sound, which provides sound playing routines for GNOME applications (http://www.gnome.org). These routines make use of the esd sound daemon.

It is important to note that Gnome->init( ) must be called before using these functions.

Gnome::Sound::init( HOSTNAME );

This initializes a connection to the esd sound server on HOSTNAME. This function must be called before using any other functions from this module. HOSTNAME is a string, or scalar containing a string, and will usually be 'localhost'.

Gnome::Sound::shutdown( );

Shuts down the connection to the sound server. This function must be called before the end of your program.

Gnome::Sound::sample_load( SAMPLE_NAME, FILENAME );

Loads sound file, FILENAME, into an esound sample with the name SAMPLE_NAME. Both SAMPLE_NAME and FILENAME are strings. Returns the esound numeric ID of the sample, or a negative number otherwise.

Gnome::Sound::play( FILENAME );

Plays the sound file FILENAME. This is a convenient wrapper around a number of esd functions, as will probably be the most used function.

SEE ALSO

Gnome

AUTHOR

Mark A. Stratman <mark@sporkstorms.org>

COPYRIGHT

Copyright (c) 2001, Mark Stratman. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.

The GNOME libraries (libgnome) are released under the LGPL (Library General Public License). Visit http://www.gnu.org for more details.