[clean-list] Playing sounds

Jeremy Shaw Jeremy.Shaw@lindows.com
Tue, 18 Nov 2003 08:02:51 -0800 (PST)


Hello,

Have you considering writing some (partial) bindings for SDL?

http://www.libsdl.org/index.php

Looking at this page, I think it would be fairly trivial:

http://sdldoc.csn.ul.ie/guideaudioexamples.php

I think you would only need call the following functions:

SDL_Init (not shown on that page).
SDL_OpenAudio
SDL_MixAudio
SDL_PauseAudio
SDL_CloseAudio
SDL_Delay

I think you will find the SDL interface much easier to use that trying to call OS specific code, and as an added benefit, SDL is ported to linux, win32, MacOS, MacOS X, BeOS, and unofficially ported to Solaris, IRIX, FreeBSD, QNX, OSF/True64.

I hope to write a full set of bindings for clean and SDL someday. SDL already has an impressive number of bindings:

http://www.libsdl.org/languages.php

Jeremy Shaw.


On Nov 18, 2003 3:06 AM, Jerzy Karczmarczuk <karczma@info.unicaen.fr> wrote:

> Ronny Wichers Schreur wrote: 
> > Jerzy Karczmarczuk writes (to the Clean discussion list): 
> >  
> >> The StdSound module in the last Clean is truncated, the call 
> >> to WinSoundPlay  is commented out, 'playSoundFile' doesn't do 
> >> anything. Why? 
> ... 
> > Peter's comment for this change is: "(PA) Uniform Object I/O dd.29 
> > juni '01.", where uniform means Mac/Windows. 
> >  
> >> WinSOundPlay exists of course, this is an inline code. Everything 
> >> finally goes to the winmm.dll, PlaySoundA@12.  Ugh. "The buck 
> >> stops here"... 
> >  
> >  
> > My guess is that if you remove the comment it will just work (only 
> > on Windows, of course). 
>  
> Alright, plus some superficial bugs such as WinSoundPlay =-=> winSoundPlay... 
> Thank you, I discovered that. So I might in principle generate a binary .wav 
> file and to play it after having read it back. 
>  
> But my *MAIN* problem persists : how to play from an internal buffer... How to 
> do it asynchronously? 
>  
> Can't really anybody there help me? This is really frustrating... 
>  
>  
> Jerzy Karczmarczuk 
>  
>  
>  
>  
>  
>  
> _______________________________________________ 
> clean-list mailing list 
> clean-list@cs.kun.nl 
> http://www.cs.kun.nl/mailman/listinfo/clean-list