www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Amper audio player for GNU/Linux and X11

reply ketmar <ketmar ketmar.no-ip.org> writes:
first, this is a weekend project to improve the underlying libraries, not a 
rival for existing audio/media players. yet it still may be of some 
interest.

Amper is a WinAMP2/XMMS insipred player, with WinAMP2/XMMS skin support. it 
is using X11 for UI and ALSA for sound output. some ineresting features of 
Amper are:

* pure D audio code, no external decoder libraries required (and no SDL);
* supports FLAC, Vorbis, Opus, MP3 playback;
* various hardware sampling rates with transparent resampling of source 
audio;
* multiband equalizer (the code is there, but UI is not ready yet);
* font rendering via FreeType, and font selecting via fontconfig;
* reading skins directly from zip archives via iv.vfs library;
* windowing via arsd.simpledisplay library;
* CLI control utility (using simple RPC library iv.ncrpc);
* notification area icon with hint window;
* sound playback is done in background thread (std.concurrency rox!);
* other k00l things i forget.

screenshot: [0]
Amper repo: [1]
IV repo (required to build Amper): [2]
ARSD repo (required to build Amper): [3]

if you have all the pathes set right, "rdmd amper.d" will start Amper.

as this is very WIP, you can't add files to playlist from UI yet (lol), so 
you have to pass 'em at command line, like this:
	rdmd amper.d mymusic.opus

WARNING! this is *WIP* code. many features are missing, and there are alot 
of bugs. yet Amper already can play music, and you can control it (to some 
extent) with a mouse. please, don't report bugs, as i probably already know 
about 'em (but tnx for trying).

i'm announcing the project at this early stage to show that D can be used 
for "serious programs", including decoding various complicated audio 
formats and DSP processing, and for writing "fancy" UIs.

please note that arsd.simpledisplay supports windows too, this is just my 
code that doesn't (but i'll eventually fix it, so Amper will be able to 
work on windows).

also please note that Amper is not a frontend to some existing audio 
decoding/playback library, all audio processing is done with D!

you will prolly need dmd 2.073.2 to build Amper (lower versions not tested).

skin credits: PipBoy2000 by Gerko.

p.s.: press ctrl+q to quit Amper. ;-)

p.p.s.: please, no reddit/lobsters/slashdot/etc.


[0] http://files.catbox.moe/y5wtak.png
[1] http://repo.or.cz/amper.git
[2] http://repo.or.cz/iv.d.git
[3] https://github.com/adamdruppe/arsd.git
Mar 16 2017
next sibling parent reply Claude <no no.no> writes:
On Friday, 17 March 2017 at 06:33:38 UTC, ketmar wrote:
 * pure D audio code, no external decoder libraries required 
 (and no SDL);
 * supports FLAC, Vorbis, Opus, MP3 playback;
 * various hardware sampling rates with transparent resampling 
 of source audio;
 * multiband equalizer (the code is there, but UI is not ready 
 yet);
So you ported the FLAC, OPUS and MP3 decoder to D ? That's huge. :)
Mar 17 2017
parent ketmar <ketmar ketmar.no-ip.org> writes:
Claude wrote:

 On Friday, 17 March 2017 at 06:33:38 UTC, ketmar wrote:
 * pure D audio code, no external decoder libraries required (and no SDL);
 * supports FLAC, Vorbis, Opus, MP3 playback;
 * various hardware sampling rates with transparent resampling of source 
 audio;
 * multiband equalizer (the code is there, but UI is not ready yet);
So you ported the FLAC, OPUS and MP3 decoder to D ? That's huge. :)
yep. and two Vorbis decoders: stb_vorbis and Xyph's Tremor. Amper is using Tremor. sure, i cheated a little: FLAC decoder is standalone dr_flac library, and Opus was ripped from ffmpeg (and the code is awful). but hey, it works! ;-) mp3 decoder is originated in ffmpeg too. it was extracted to minimp3.c library by i-forgot-who, and then i ported it to D.
Mar 17 2017
prev sibling next sibling parent reply Guillaume Piolat <first.last gmail.com> writes:
On Friday, 17 March 2017 at 06:33:38 UTC, ketmar wrote:
 i'm announcing the project at this early stage to show that D 
 can be used for "serious programs", including decoding various 
 complicated audio formats and DSP processing, and for writing 
 "fancy" UIs.

 please note that arsd.simpledisplay supports windows too, this 
 is just my code that doesn't (but i'll eventually fix it, so 
 Amper will be able to work on windows).

 also please note that Amper is not a frontend to some existing 
 audio decoding/playback library, all audio processing is done 
 with D!
There is a crazy amount of work here. Congrats ketmar. I've always been curious of what Amper looked like!
Mar 17 2017
parent ketmar <ketmar ketmar.no-ip.org> writes:
Guillaume Piolat wrote:

 There is a crazy amount of work here. Congrats ketmar.
 I've always been curious of what Amper looked like!
tnx. it will be even more impressive with equalizer UI finished! ;-) there is no documentation on Amper console commands, but i can secretly tell you that user is able to change the skin without restarting Amper, for example. and do alot of other things (including equalizer control), which are impossible to do from UI yet. ;-) tbh, Amper is not that complicated: it mostly using already written libraries. most of the Amper code was done in three days, 'cause i already have console audio player, and ALSA backend. Adam's excellent simpledisplay.d took care of low-level window manipulation tasks (and image loading).
Mar 17 2017
prev sibling next sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
ketmar wrote:

 if you have all the pathes set right, "rdmd amper.d" will start Amper.
quickfix: "rdmd -J. amper.d" ;-)
Mar 18 2017
prev sibling next sibling parent reply ketmar <ketmar ketmar.no-ip.org> writes:
fixed some issues with 64bits compilation. tnx, NotSpooky!

yet it is not possible to build 64bit Amper due to dmd bug:

	Error: undefined identifier '__va_list_tag'

yes, exactly like that: no error line, nothing more. sorry, i don't have 
64bit system, so i cannot do much with that. i tried some obvious 
workarounds, but without any success. 32bit ftw!
Mar 18 2017
next sibling parent Kagamin <spam here.lot> writes:
dmd -m64 -c amper.d
should work on 32-bit system too and compile to 64-bit code.
Mar 20 2017
prev sibling parent Kagamin <spam here.lot> writes:
Also 
https://github.com/ldc-developers/druntime/blob/ldc/src/object.d#L48 may shed
some light, but it sounds strange.
Mar 20 2017
prev sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
some updates:

* region.txt support for skins;
* reworked equalizer (smaller, faster);
* background scanner for playlist items (Amper won't hang when adding alot 
of files to playlist anymore);
* ID3v2 parser, so mp3s will have (some) metainfo too;
* fully configurable global hotkeys (including hotkeys for playback control);
* better on-the-fly skin reloading;
* pure X11 renderer, so Amper is using much less memory now.
Mar 24 2017