| Re: [AD] proposed changes to sound API | 
[ Thread Index | 
Date Index
| More lists.liballeg.org/allegro-developers Archives
] 
On December 16, 2008, Matthew Leverton wrote:
> Before I submit any smaller patches, I'd like to propose some bigger
> changes to the sound API.
>
> http://wiki.allegro.cc/NewAPI/Sound/Proposed
>
> I don't like how the "simple" layer is made to be an all/or nothing
> thing. If the regular API is too difficult, then it is designed wrong.
> The changes I'm proposing would remove the distinction between the two
> layers while keeping the current behavior almost the same. In short:
>
> * Rename al_setup_simple_audio() to al_reserve_sample_slots().
>
> * Provide methods to get/set the default mixer.
>
> * Rename ALLEGRO_SAMPLE to ALLEGRO_SAMPLE_PLAYER
>
> * Rename ALLEGRO_SAMPLE_DATA to ALLEGRO_SAMPLE
>
> * Support WAV files out of the box.
>
> The average user would just reserve somes slots and use al_play_sample().
>
> If you need more than that, you could install your own voice and
> mixer, set it as the default, then reserve some sample slots. Thus,
> you can still use al_play_sample() for your basic samples, and set up
> an ALLEGRO_SAMPLE_PLAYER for each of your samples that have more
> complex parameters.
I have a couple comments:
Wouldn't it be better to have the reserved sample slot number given to 
al_install_audio, I'd imaging that al_install_audio would reserve a default 
number, then a call to reserve_sample_slots would change it for no good 
reason. imo, it'd be better to just tell the system how many you want, or -1 
(to use the default number) on init.
And this sample id thing, this is what voices in allegro 4 were. And is what I 
assume a ALLEGRO_VOICE is. Voice's are the playing instance, SAMPLEs are the 
loaded sound.
> --
> Matthew Leverton
>
> ---------------------------------------------------------------------------
>--- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada. The future of the web can't happen without you.  Join us at MIX09
> to help pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com
>/
-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx