Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!acorn!john From: john@acorn.co.uk (John Bowler) Newsgroups: comp.windows.x Subject: Re: X11R5 wish: better sound Summary: Acorn-Noise extension Keywords: Sound, Acorn-Noise Message-ID: <2626@acorn.co.uk> Date: 2 Aug 90 14:11:18 GMT References: <990003@hpnmdla.HP.COM> Reply-To: john@acorn.UUCP (John Bowler) Organization: Acorn Computers Ltd, Cambridge, UK Lines: 46 In article <990003@hpnmdla.HP.COM> roger@hpnmdla.HP.COM (Roger Petersen) writes: >I'd like an easier, better sounding way of playing music or generating >tones in X11. > >Right now, there's the XBell() and XChangeKeyboardControl() functions, >which allow setting the pitch, duration, and volume, and then generating >the sound. But which give absolutely no guarantees that the server will be able to do this and, worse, there is no way of finding out what the server will do. >What I'd really like is a way to pass the XBell() routine (or maybe some >*new* XSound() routine) a pointer to an array of tones structs. The >structure could be the same as the XKeyboardControl structure, or maybe a >simpler one: > > typedef struct { > int bell_percent; > int bell_pitch; > int bell_duration; > } XBellTone; /* pick your favorite name here */ > >Then I could simply pass the XSound() routine a pointer to an array of >XBellTones, and it would play the tones synchronously, one after the other. >For pauses, the bell_pitch would simply be set to full off. > >[Notice that I didn't ask for support for multipe voices, noise sources, >streams of digitized sound, etc. These *could* be considered too...] The more you ask for, the less likely you are that any server can do it... We've just finished developing an extension similar to the above which takes ``sounds'' expressed as 8, 16 or 32 bit samples and allows them to be ``played''. The extension gives considerable freedom to the server (eg, the sounds won't necessarily be played one after the other, the server might even stop doing anything else while playing the sound, you may not get any choice about sample rate and so on). The client can find out about this and choose not to use the interface if it wants. The current API is crude (Xlib level), the only server implementation is for our own hardware. I will make the details public if anyone is interested. The extension name (*NOT* yet registered; although our manufacturer prefix is) is Acorn-Noise. John Bowler (jbowler@acorn.co.uk)