From: pekangas AT sci DOT fi (Petteri Kangaslampi) Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro sound bitstreams Date: 19 Jun 1997 11:20:15 GMT Organization: Scifi Communications International Oy, http://www.sci.fi/, helpdesk AT sci DOT fi, 03 2899111 Lines: 36 Message-ID: References: <5o74ss$65q$1 AT readme DOT ican DOT net> Reply-To: pekangas AT sci DOT fi NNTP-Posting-Host: ns.sci.fi To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 17 Jun 1997 23:02:42 GMT, Andrew Ellem wrote: >Is is possible to create a bitstream to the sound card? I'm trying to get a >MPEG Layer 3 player working, but it requires a streamed output to the sound >device. Is there anyway to get this to work, or will I have to resort to >filling out a SAMPLE and playing it? I don't know if this is possible with Allegro, might be, but I suggest you also check out MIDAS Sound System 1.0 beta 1. It isn't really recommended for most DOS users (use 0.7beta1 instead), but it includes stream support also in DOS, for all supported sound cards. After initializing the system, you can just start playing a stream, and feed the decompressed data from a memory buffer to MIDAS. The stream feed function can even block until all data from the buffer has been fed, working almost exactly like write()ing the data to /dev/audio or something. I originally ported splay to Win32 platforms by using MIDAS myself, I think the whole porting process took about a half an hour - and I used Watcom C, not GCC. I might have the MIDAS-using version of splay still around somewhere, mail me if you think it would be useful. I have also ported both splay and mpg123 to Win32 using the Win32 audio API directly. The downside of using MIDAS for this is, that you end up mixing the whole stream in software before outputting it to the sound card. This can take quite a bit of CPU time, especially as the MIDAS mixing routines for 16-bit samples are really not all that well optimized in 1.0b1 (read: not at all :) It has its benefits though - you can play a 44.1kHz 16-bit stereo stream on an old mono 8-bit Sound Blaster :) MIDAS is free for non-commercial use, check http://kalahari.ton.tut.fi/s2/midas/. 1.0 beta 1 includes stream support for DOS, as well as DJGPP support, 0.7 beta 1 doesn't support stream playback in DOS, but might be a better idea for other DOS use. Earlier versions do not support DJGPP. Petteri, one of the authors