> On Jan 27, 2016, at 6:02 PM, Lehi Toskin <lehi.tos...@gmail.com> wrote:
> 
> On Wednesday, January 27, 2016 at 11:41:06 AM UTC-8, Jordan Johnson wrote:
>> Hi all,
>> 
>> 
>> I'm looking at audio again because I have a student doing a game project for 
>> which he wants background music to play — and I'm feeling some trepidation 
>> based on most of the audio-tagged packages on pkgs.racket-lang.org showing 
>> some test failures or other build problems.
>> 
>> 
>> His minimal goal is to loop a sound file from the start of play until the 
>> end, and have it work on Windows and Mac. We tried play-sound from 
>> racket/gui/base, and it almost fits: we just need to be able to kill the 
>> sound at the end, and it seems that killing the sound-playing thread is not 
>> enough. Is there a way to stop the audio?
>> 
>> 
>> His ideal goal is to be able to play different background music depending on 
>> the room the player is in. AFAICT this is beyond play-sound's ability, at 
>> least if he wants to do smooth transitions. Is there another library which 
>> would facilitate cross-fading from one audio file to another?
>> 
>> 
>> More generally, what are currently our best tools for incorporating music 
>> and sound effects into Racket games?
>> 
>> Best,
>> Jordan
> 
> This may be larger than the scope of the project, but there is an audio 
> library called RSound, which uses PortAudio (via a wrapper). It's more robust 
> and I'm certain there are things you could do with it that you couldn't with 
> play-sound.

Hi there! Author of rsound here.

If you’re concerned about test failures in pkg.racket-lang.org… well, my test 
cases try to load the shared libraries and play sound, so that’s not possible 
in pkg.racket-lang.org’s environment. I suppose I should refactor those tests 
so that only the ones that can run without portaudio get run.

RSound can certainly give you the ability to start, stop, and cross-fade sounds.

I’m guessing you’re looking for an imperative API that looks something like 
this:

(start-playing! stream sound at-time #:fade-in time-duration) => token
(stop-playing! stream token at-time #:fade-out time-duration)


… right?

John



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to