Anyone interested in simpleaudio.d too?

Daniel Gibson metalcaedes at gmail.com
Tue Apr 12 05:50:38 PDT 2011


Am 12.04.2011 14:40, schrieb Michel Fortin:
> On 2011-04-12 07:47:48 -0400, Daniel Gibson <metalcaedes at gmail.com> said:
> 
>> Am 12.04.2011 13:44, schrieb Michel Fortin:
>>> On 2011-04-12 07:18:39 -0400, Daniel Gibson <metalcaedes at gmail.com>
>>> said:
>>>
>>>> Also you shouldn't write directly against OSS or ALSA but use SDL or
>>>> OpenAL or libao or ... instead.
>>>
>>> The problem with intermediary libraries is that they require work on the
>>> programmer side to work. I think there is value in being able to write a
>>> simple program just by importing std.simpleaudio and having it work
>>> instantly without having to install any library or play with linker
>>> flags (which will be handled by pragma(lib) if you let DMD handle the
>>> linker). And it's also easier to distribute your app if it doesn't
>>> depend on dynamic libraries not installed by default on the system.
>>>
>>> I'm not saying those libraries are not useful, only that they come with
>>> some complications.
>>
>> Err.. I didn't say "don't use std.simpleaudio" but "don't use OSS/ALSA
>> directly but some platform independent abstraction" - which could as
>> well be your std.simpleaudio :)
> 
> I misunderstood then. I thought you were saying that std.simpleaudio
> should be implemented using one of these platform abstractions. Actually
> it could, but I think it'll diminish its value.
> 

This doesn't contradict itself ;)
I think it would make sense to let simpleaudio use one of these
abstractions so it's easier to port it to new platforms (ideally there
wouldn't be any porting involved it all because the abstraction already
does that).
But the user using simpleaudio shouldn't be bothered with these details
- the interface for simpleaudio should be the same regardless of what it
uses to communicate with the sound hardware (OSS/ALSA/windows
whatever/SDL/...). It needs to abstract away these details anyway to be
the same on windows/Linux/OSX/...


More information about the Digitalmars-d mailing list