🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.amiga.tech
2 messages
2 total messages Started by Joseph Peck Fri, 14 Dec 1990 17:10
Simple Audio question
#7463
Author: Joseph Peck
Date: Fri, 14 Dec 1990 17:10
25 lines
1269 bytes
Hello all.  I have a quick question on how to correctly select an 
audio channel for playing a sound.

Currently everything works; i.e. I allocate all 4 channels, and can 
play a sound on any given channel.  However, I get warnings when I
compile my program with lattice C.  I select the channel with:

AIOptr->ioa_Request.io_Unit = #;

where # is either 1,2,3 or 4.

I am assuming that I should be putting something other than just simple
constants here, but the RKM's don't cover this too well. (I am sure that
someone will probably disagree with me, but I really don't see it)

The better part is that the RKM's refer to io_Unit as a bit field, while
the header files seem to think that it is a pointer to a structure.
Maybe I am just too tired to read it correctly.....

So, can anyone give me a hand?

Thanks,
Joe Peck
peck@ral.rpi.edu
Re: Simple Audio question
#7547
Author: Ken Farinsky - CATS
Date: Mon, 17 Dec 1990 18:52
40 lines
1864 bytes
In article <8GG^X6$@rpi.edu> peck@ral.rpi.edu (Joseph Peck) writes:
>
>...how to correctly select an audio channel for playing a sound.
>
>I get warnings when I compile my program...I select the channel with:
>
>AIOptr->ioa_Request.io_Unit = #;  /* where # is either 1,2,3 or 4. */
>
>Joe Peck peck@ral.rpi.edu

I'm not the audio expert, but I'll try to answer your questions.
Looking through the RKM (Libs&Devs) in the Audio Device section, I found:

p610:  You specify the channel that you want to use by setting the
appropriate bits in the ioa_Request.io_Unit field...

from p615, it looks like the bits are set up as follows:

	CHANNEL_0	(1<<0)
	CHANNEL_1	(1<<1)
	CHANNEL_2	(1<<2)
	CHANNEL_3	(1<<3)

Also, from page 614:  If the allocation succeeds, the audio device
will return the channels that you now own in the lower four bits
of the ioa_Request.io_Unit field...So I would guess that you don't
use numbers like 1,2,3 or 4.

So, even though the field is a pointer, you have to put bit values into
it.  Try something like:

	AIOptr->ioa_Request.io_Unit = (struct Unit *)(CHANNEL_0);

Also, remember to mask out any unused bits when checking the value of
this variable and to set unused bits to zero when setting this variable.
-- 
--
Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines
uucp: ken@cbmvax.commodore.com   or  ...{uunet,rutgers}!cbmvax!ken
bix:  kfarinsky
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads