External library - multiple audio formats?

Previous topic - Next topic

Darmakwolf

In a windows-only game I want to support Commodore .sid audio - has someone already made a wrapper for a library to do so in GLB?  :blink:

matchy

I'm not sure but one of these might be able to, at least with an add-on. Do you really, really, really need it to be in .sid format? Also just wondering if it is from an original commercial title?


bass.dll
http://www.glbasic.com/forum/index.php?topic=1708.msg12010

fmod
http://www.glbasic.com/forum/index.php?topic=7564.msg62935

kanonet

I wonder the same like matchy, do you really need that format? Wouldnt a converter be the better solution to use that sounds?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

mentalthink

More easy convert from a tracker to .wav...

S.O.P.M.

With Winamp you can easily output that sid as an mp3 or wav file. Just use the Winamp sid plugin and then set the output plugin to Winamp Disk Writer, it writes the file in a desired format. I would do so.
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

spicypixel

I'm guessing that the idea of playing the sid file is to keep the audio small. I had a dll for playing AY/YM in BlitzBasic years ago but nothing from back then on playing SID to even use as a starting point :( As for playing SID in Winamp and converting to WAV, Winamp hasn't got the best replay engine for tracker or old computer formats.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Darmakwolf

Well I can now convert sid to mp3 very easily, but the whole idea is filesize. Some songs are 2KB and sound great. Even at the lowest quality MP3 it's >1MB... I'll look into FMOD. And it's not for a commercial title or anything.

erico

On the ´converter / player´ part, you can try FOOBAR too, It is what I use as a music player. I think I saw some plugins for SID a while ago.

Darmakwolf

#8
Ok so I think I found my solution. I forgot that a while back I messed around with RPG Maker's RGSS (ruby) language and helped get a winamp.dll to play .SPC files. Here's the link:

http://forums.rpgmakerweb.com/index.php?/topic/2235-extended-music-script-35/

I just can't seem to wrap the winamp.dll file properly... I tried to get it to initialize like this:

Code (glbasic) Select
IMPORT "C" long Init_Winamp(char* inDLL, char* outDLL, void* hwnd)

and then called

Code (glbasic) Select
Init_Winamp("in_snes.dll","out_wave.dll",0)

but it spits out

Code (glbasic) Select
...gpc_temp0.o:gpc_temp0.cpp:(.text+0x1a14d): undefined reference to `_Init_Winamp'
*** FATAL ERROR - Please post this output in the forum


If I can get help properly wrapping Winamp.dll, we can play lots and lots of game music formats...
attached is Winamp.dll, the in_snes plugin, the out_wave plugin, and an example .spc file to play. It works in RPG Maker purely by initializing winamp and throwing a song at it... there must be a way to do this.

===========================================================================

EDIT: I realized I needed:

REQUIRE "Winamp.dll" and then it gets past that error, but now I think my problem is defining the proper variable types for Winamp.DLL. It gets some scary looking errors with my current setup...

Schranz0r

Hi,

make a new file in your project and past this:
Code (glbasic) Select

INLINE

#define WINAMP "Winamp.dll"


DECLARE_C_ALIAS(_Init_Winamp, WINAMP, "Init_Winamp",(const char*, const char*, void*), long);

ENDINLINE



FUNCTION Init_Winamp:
INLINE

return _Init_Winamp("in_snes.dll","out_wave.dll", GLBASIC_HWND());

ENDINLINE
ENDFUNCTION


it returnes -3 , it's say that the in_dll is wrong...
but trust me, the init isn't work this way!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Darmakwolf

Well - there's this.

http://www.glbasic.com/showroom.php?game=fmodPlayer

seems to play .sid without any special plugins. The .exe that comes WITH the project works fine, I can hear the music!!
The source code on the other hand isn't fine. It'll compile... but it returns 0 and no sound is played. Using GLBasic 11.322. Can someone please get this to compile/work? I'd be forever grateful...

Darmakwolf

I think it was compiled with GLBasic 3.x ... that's a long time ago. I suspect something changed with the way DLLCALL is handled... but the compiler does not complain... the actual program just does nothing when compiled. Like I said before though, the original .exe that is in the demo works great... I don't get it o_o  :rant:

Schranz0r

I give you start to fmodex later. I'm on the road atm.
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Darmakwolf

Thanks Schranz0r! I did manage to get "sidplayfp" working great because it's a command-line too, all I needed to do was use SHELLCMD to call it with a music playing function. It runs in the background and loads .sid audio instantaneously - should I stick with that or is FMOD dll really a better solution?