Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AHI Device"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
Line 9: Line 9:
 
Many sample frames stored in sequence as an array can be called a sound. A sound is, however, not limited to being formed by samples. It can also be parameters to an analog synth or a MIDI instrument, or be white noise. AHI supports only sounds formed by samples.
 
Many sample frames stored in sequence as an array can be called a sound. A sound is, however, not limited to being formed by samples. It can also be parameters to an analog synth or a MIDI instrument, or be white noise. AHI supports only sounds formed by samples.
 
== AHI Device ==
 
== AHI Device ==
AHI device has two different APIs: a library-like function interface (for low-level access) and device interface (for high-level access).
+
AHI device has two APIs: a library-like function interface (for low-level access) and device interface (for high-level access).
   
 
== AHI Device Commands and Functions ==
 
== AHI Device Commands and Functions ==

Revision as of 19:32, 16 March 2017

About AHI

Definitions

Terms used in the following discussions may be unfamiliar. Some of the more important ones are defined below.

Sample
A sample is one binary number, representing the amplitude at a fixed point in time. A sample is often stored as an 8 bit signed integer, a 16 bit signed integer, a 32 bit floating point number etc. AHI supports only integers.
Sample frame
In mono environment, a sample frame is the same as a sample. In stereo environment, a sample frame is a tuple of two samples. The first member is for the left channel and the second member is for the right channel.
Sound

Many sample frames stored in sequence as an array can be called a sound. A sound is, however, not limited to being formed by samples. It can also be parameters to an analog synth or a MIDI instrument, or be white noise. AHI supports only sounds formed by samples.

AHI Device

AHI device has two APIs: a library-like function interface (for low-level access) and device interface (for high-level access).

AHI Device Commands and Functions

Device Interface

Opening the AHI Device

Reading from the AHI Device

Writing to the AHI Device

Closing the AHI Device

Function Interface

Opening the AHI Device for Low-level Access

Obtaining the Hardware

Declaring Sounds

Playing Sounds

Closing the AHI Device