View Single Post
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 11-09-2021 , 05:09   Re: [EXTENSION] Sound Info Library v1.0.1
Reply With Quote #96

Quote:
Originally Posted by AdRiAnIlloO View Post
Done: https://github.com/Adrianilloo/sound...e/soundlib.inc

Thanks for your contribution.

Sample output from working methodmap based API:

Code:
sm plugins reload soundlib_demo
[SM] Plugin soundlib test reloaded successfully.
sm_soundinfo 02 CP Violation.mp3
Song Info 02 CP Violation.mp3
Sound Length: 105
Sound Length (float): 105.508575
Birate: 320
Sampling Rate: 44100
Artist: Valve
Title: CP Violation
Num 2
Album: The Soundtrack of Half-Life 2
Year: 2004
Comment: 0
Genre: Soundtrack
If you're going to test sounds from VPKs (and/or additional search paths), or just my upgraded extension in general, let me know how it goes (whether you find any issue etc.).

[+General info: I recently added support to SaySounds plugin (which uses SoundLib) with required edits to support VPK / search path reading as well, which requires my edited SoundLib: https://github.com/Gh0sty/SaysoundsHE]
Thanks, but i meant native functions in the methodmap.
For example:
Code:
	property float LengthFloat
	{
		public native get();
	}

	property int Year
	{
		public native get();
	}
And native methods would be declared in the extension as natives.
Code:
sp_nativeinfo_t g_SoundLibraryNatives[] =
{
	{"OpenSoundFile",			OpenSoundFile},
	{"GetSoundLength",			GetSoundLength},
	{"GetSoundLengthFloat",		GetSoundLengthFloat},
	{"GetSoundBitRate",			GetSoundBitRate},
	{"GetSoundSamplingRate",	        GetSoundSamplingRate},
	{"GetSoundArtist",			GetSoundArtist},
	{"GetSoundTitle",			        GetSoundTitle},
	{"GetSoundNum",				GetSoundNum},
	{"GetSoundAlbum",			GetSoundAlbum},
	{"GetSoundYear",			        GetSoundYear},
	{"GetSoundComment",			GetSoundComment},
	{"GetSoundGenre",			GetSoundGenre},

        // native methods
        {"SoundFile.LengthFloat.get",         GetSoundLengthFloat},
        {"SoundFile.Year.get",                   GetSoundYear},
        // and for all other native methods

	{NULL,				        NULL},
};
__________________

Last edited by MAGNAT2645; 11-09-2021 at 05:11.
MAGNAT2645 is offline