Author
|
Message
|
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
|
08-03-2008
, 18:21
[EXTENSION] Sound Library (mp3/wav)
|
#1
|
THIS EXTENSION IS DEPRECATED, USE MY NEW ONE: [EXTENSION] Sound Info Library 0.9 beta
Description:
This extension provides functions for reading useful infos out of mp3 and wav files (sound length, bitrate, sampling rate, mp3 ID3 tag...), I decided to do this because the hl2 internal GetSoundDuration function doesn't work properly.
It can be used in plugins like saysounds, and other sound player plugins.
Atm this is for windows only, but I I'm going to add linux support later.
Code:
**
* Opens a sound file.
*
* @note Sound files are closed with CloseHandle().
*
* @param file File to open.
* @return A Handle to the sound file, INVALID_HANDLE on open error.
*/
native Handle:OpenSoundFile(const String:file[]);
/**
* Gets the sound length of a sound
*
* @param hndl Handle to the sound file.
* @return The song length in seconds
*/
native Float:GetSoundLength(Handle:hndl);
/**
* Get the Bit rate of sound (kbps)
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundBitRate(Handle:hndl);
/**
* Get the Sampling rate of sound (hz)
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundSamplingRate(Handle:hndl);
/**
* Get the Artist of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Artist(Handle:hndl, String:buffer[], maxlength);
/**
* Get the Track title of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Title(Handle:hndl, String:buffer[], maxlength);
/**
* Get the Track number of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Num(Handle:hndl);
/**
* Get the Album of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Album(Handle:hndl, String:buffer[], maxlength);
/**
* Get the Year of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Year(Handle:hndl, String:buffer[], maxlength);
/**
* Get the Comment of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Comment(Handle:hndl, String:buffer[], maxlength);
/**
* Get the Genre of mp3 sound
*
* @param hndl Handle to the sound file
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetSoundMp3Genre(Handle:hndl, String:buffer[], maxlength);
Last edited by berni; 11-04-2011 at 14:07.
|
|
|
|