flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > Small, statically linkable audio library (like BASS)?

Author
Thread Post new topic Reply to topic
jazz



Joined: 16 Jul 2016
Posts: 47
Small, statically linkable audio library (like BASS)?
As an exercise to myself, I would like to write a simple command-line music player in FASM. The easiest way would probably be to just add the BASS DLLs and invoke their methods, but that would require serving a whole folder full of extra DLL files which would somehow invalidate my choice to keep it small.

Is there a "linkable", compact audio library with similar features available?

_________________
invoke Beer
Post 10 Oct 2016, 16:18
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1104
Location: Russian Federation
Look at minifmod
Post 11 Oct 2016, 04:33
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
Is there a website for that? fmod.org doesn't seem to have it.
Post 11 Oct 2016, 07:47
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 255
MiniFMOD seems to have disappeared without a trace.

This thread on Pouet <http://www.pouet.net/topic.php?which=3372&page=1> points out an alternative called uFMOD here <http://ufmod.sourceforge.net/>, but it only appears to play XM mods, and I'm not sure if that's what you want.
Post 11 Oct 2016, 08:22
View user's profile Send private message Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
I don't actually have MOD files. Sad
I guess it's BASS then. Thank you though!
Post 12 Oct 2016, 10:26
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 72
Location: Belarus
Since you seem to write a Windows application anyway, why not just use something like DirectShow? It actually requires the library being installed to the system, but AFAIR it’s a part of Windows SDK (not DirectX SDK) for quite a long time yet. It is installed on most computers anyway. Allows playing anything you have codecs installed for, including even videos (may even create a simple video window for you).

I got a 6 KB program easily that shows a windows with progress bar while playing a file specified in the command line. I guess, 8 KB might even let you change playing position and manage simple playlists. And you might want to pack the executable to make it even smaller.
Post 13 Oct 2016, 07:20
View user's profile Send private message Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47

DimonSoft wrote:
installed on most computers



So what about the others?

Also, at least on my machine, the number of installed codecs is usually rather low. I'd have to install a number of codecs then - is that easier? (Or am I just looking in the wrong place?)

6 KB sounds nice though.

_________________
invoke Beer
Post 13 Oct 2016, 18:54
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 143
Location: Madrid - Spain
If you are thinking about mod files, maybe MCI is not for you.

Some time ago I wrote an unfinished but working multimedia player in FASM that can reproduce everything what is able to play the MCI-win-api: sound and video with codecs. It uses the FFT algorithm for the spectrum bars, but you have to turn on the wave-in audio to make it work. In 13 Kb.

Some time ago I started to program in DirectSound, but I stopped due of lack of time. Maybe this is the right way to play mod files.
Post 14 Oct 2016, 06:25
View user's profile Send private message Visit poster's website Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
No, I actually want to play music (FLAC, MP3, Vorbis). Smile
Post 14 Oct 2016, 09:25
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 143
Location: Madrid - Spain
In that case, maybe MCI is for you
Post 14 Oct 2016, 10:04
View user's profile Send private message Visit poster's website Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
What's MCI now?
Post 14 Oct 2016, 11:20
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 255
Post 14 Oct 2016, 11:21
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 143
Location: Madrid - Spain
An small fasm sample


Description:
Download
Filename: MCI_Fasm.zip
Filesize: 124.37 KB
Downloaded: 92 Time(s)


_________________
Siempre aprendiendo
Post 14 Oct 2016, 12:42
View user's profile Send private message Visit poster's website Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
Thank you. I just tested it: My Vorbis files don't seem to work even in the "All Files" filter. Which file types are supported by MCI?

-edit- Found it: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions.
Looks like OGG isn't supported, so I'd have to require additional software again.

Sigh.
Post 14 Oct 2016, 18:40
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 72
Location: Belarus

jazz wrote:

DimonSoft wrote:
installed on most computers



So what about the others?

Also, at least on my machine, the number of installed codecs is usually rather low. I'd have to install a number of codecs then - is that easier? (Or am I just looking in the wrong place?)

6 KB sounds nice though.


If you don’t have the codecs installed, you will need to either include them with your program or write your own ones, possibly as part of your program. It doesn’t really matter how you implement this: you still have to include instructions to decompress the source data into raw sound data, either in the form of separate codecs (3rd party or your own) or modules of your own application.

The whole purpose of codecs is to make it easier for audio/video players to support new multimedia formats by separating the UI from the algorithms behind different formats.

---

BTW, AFAIK MCI still uses the concept of codecs and relies on them being installed. Besides, it has been deprecated by Microsoft since 1999 (http://xtras.tabuleiro.com/support/technotes/general/gn001.htm). It (as well as VfW) predates DirectShow, and even DirectShow is considered outdated by now, MS recommends to use something called Windows Media Foundation instead.

The problem with Media Foundation though is that it is not supported by WinXP– versions of Windows.

---

<offtop>The player I’ve mentioned was one of the programs I wrote as examples for my students. You may find it (as well as a simple virtual piano) here: http://lessthan.16mb.com/ Source codes are also available on demand, but they were written in a hurry and thus are quite “dirty” so I decided not to share them in public.</offtop>
Post 16 Oct 2016, 13:15
View user's profile Send private message Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
I don't have Windows XP and I don't plan to make my software compatible with it. Very Happy
But WMF requires additional codecs for (e.g.) FLAC again. Microsoft should really consider to develop their own ones.


Quote:
If you don’t have the codecs installed, you will need to either include them with your program or write your own ones, possibly as part of your program.



Including them provides no advantage over using BASS again; and (given that I plan to distribute the files one day) I'm not really a fan of "please install these 3525 extra packages before you can use my super-small software". Polluting computers with dependencies is a quite bad idea.

I briefly looked at your player. Nice. Smile

_________________
invoke Beer
Post 16 Oct 2016, 13:28
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 72
Location: Belarus

jazz wrote:
Including them provides no advantage over using BASS again; and (given that I plan to distribute the files one day) I'm not really a fan of "please install these 3525 extra packages before you can use my super-small software". Polluting computers with dependencies is a quite bad idea.


In fact you didn’t have to install any of them to run my sample program, right? Smile

Anyway, I just wanted to pay your attention to the fact that Windows version of BASS still requires DirectX being installed. But it still has its own advantages over DirectShow.
Post 17 Oct 2016, 14:21
View user's profile Send private message Reply with quote
jazz



Joined: 16 Jul 2016
Posts: 47
Your sample program has a small selection of supported codecs, right? Smile

I don't plan to make my application compatible with old Windows versions. New ones come with DirectX preinstalled...
Post 17 Oct 2016, 14:27
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.