Article View: comp.sys.amiga.tech
Article #12098Re: Audio questions
From: William J. Murphy
Date: Tue, 04 Apr 1989 02:44
Date: Tue, 04 Apr 1989 02:44
34 lines
2213 bytes
2213 bytes
In article <2093@pur-phy> murphy@newton.physics.purdue.edu (William J. Murphy) writes:
>
>I've just finished typing in and compiling Bob Peck's program audio.c
>from Programmer's Guide to the Amiga (gee that sounds like Hitchhiker's
>Guide to the Galaxy, was that similarity intended Bob?). Anyhow, I see how
>one can control the sampling rate of the audio chip, but how do I convert that
>into real time numbers? Let's say for example your waveform has 16 data points
>and you set the period value to be 428, what frequency would you be producing
>out of the speaker?
>
>My guess is that it will be freq = sampling rate/(428 * 16), but what's the
>sampling rate?
Well, to answer my own questions, I dug through an RKM at the bookstore and
found that each tic of period = 279.365 ns. Thus the formula is
frequency = 1/(279.365e-9 * Period * Repeat_of_Data)
= 1/(279.365e-9 * 428 * 16) = 522.7 Hz
>
>The next question that I have may be a bug in the program. When I played the
^^^ Or a bug in the programmer!!!
>program 12 times in a row, I received an error "cannot create a reply port".
>This makes me think that something is not returning its port to the system.
>I checked my program, and the DeletePort(auReplyPort) and DeletePort(auLockPort
^^^^^^^^^^^^^^^^^^ and I just checked it again, my error for not CALLING
finishup to delete the appropriate ports. Sorry. :-(
Bill Murphy "Facts!, what we demand are solid facts!
murphy@newton.physics.purdue.edu Wait, What we demand is a total absence of
solid facts." Vroomfondel, Philosopher.
-------------------------------------------------------------------------------
>
Technical Details
Message-ID:
<2097@pur-phy>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!pur-ee!pur-phy!murphyReferences:
<2093@pur-phy>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!pur-ee!pur-phy!murphy From: murphy@pur-phy (William J. Murphy) Newsgroups: comp.sys.amiga.tech Subject: Re: Audio questions Message-ID: <2097@pur-phy> Date: 4 Apr 89 02:44:06 GMT References: <2093@pur-phy> Reply-To: murphy@newton.physics.purdue.edu.UUCP (William J. Murphy) Organization: Purdue Univ. Physics Dept., W. Lafayette, IN Lines: 34