> On Apr 21, 2017, at 18:34, Cleverson Casarin Uliana <cleve...@gmail.com> 
> wrote:
> 
> Hello, I need playing/stopping a given audio file (may be wav, ogg, etc.), 
> checking whether the sound is still playing, and stop it/start a new sound 
> upon a key press. Is there support for it, prefferably using the OS native 
> resources? In case there are only bindings to external libs, what's the more 
> responsive and/or the easiest just for such basics?

I wish I had a nicer answer for you. Here’s the state of the world, as far as 
I’m aware of it:

1) Racket has built-in support for playing sound files. This function is called 
play-sound, and you can read the docs for it.

2) Jay McCarthy’s openal package (installable using ‘raco pkg install openal’) 
provides FFI bindings to OpenAL, which does almost exactly what you want. 
AFAICT, it’s not currently documented.

3) It is possible to do what you want using  (my) rsound package (installable 
using ‘raco pkg install rsound’). It can do what you want, but it has a few 
major drawbacks. Let me enumerate them.

a) It has built-in support for reading .wav files, that’s all.
b) If you want to be able to stop a sound, you’ll want to put it on its own 
stream, so that you can just set its volume to zero. It wouldn’t be hard to 
implement individual sound stopping, but it’s not currently documented.

Well, those are probably the two biggest :).

In case you’re not already aware of this, you can read more information about 
the packages available for Racket at 

https://pkgs.racket-lang.org/

John Clements



-- 
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