Mail Archives: djgpp/1999/02/18/19:46:55
<M DOT A DOT Bukin AT inp DOT nsk DOT su> wrote in message
news:20zp6bu74w DOT fsf AT Sky DOT inp DOT nsk DOT su...
>"Andrew Davidson" <andrew AT lemure DOT freeserve DOT co DOT uk> writes:
>
>> I think I'm approaching this problem from the wrong angle. Rather than
play
>> a sample through allegro's functions is there any way I can simply flex
or
>> relax the speakers a single time? Is there an ultra low-level allegro
>> function I can get at to do this? This would be a similar function to
>> writing to port 61h on a pc, but would affect the speakers wired up to
the
>> sound card, rather than the pc speaker.
>
>You can try MIDI, but I doubt that you can find really good notes for
>noise. But why do you need it this way at all? Samples played with
>play_sample are mixed together, and one buffer is sent to sound card,
>when sound card finishes playing this buffer, it generates interrupt
>and mixer prepares next buffer (or program is polling the state of
>sound card in timer interrupts at intervals of some milliseconds and
>detects when it is time to prepare next buffer). Overhead is not
>large (it is small) and you can use play_sample for playing noise.
Yeah sorry, I should have explained this better. I'm trying to emulate a
simple speaker like that connected to the pc or spectrum which is activated
by flipping a single bit in a port somewhere. This would obviously be
emulated rather well by doing much the same thing but with the speakers
connected to a sound card (as pc speakers just don't have the omph necessary
really). I've had some interesting posts about the physics behind sound
generation and how I can't expect to get identical sound without putting in
appropriate pauses before changing the state of the speakers and such but
that's all for later. Really I just want to know if such a simple function
is available on todays flashy soundcards. I have a nasty feeling it wouldn't
be as there is no real need to flex or relax a speaker these days when the
sound card can do all that for you. Nevertheless, if it is still doable I'd
really appreciate a description of how and if it can be done with allegro's
sound functions that would be even better as it would allow support for more
than one type of sound card without having to learn how to program them
myself.
Thus MIDI isn't really what I want here, I think, as it's far too
high-level.
- Raw text -