The Media Kit

The Media Kit is undergoing massive surgery. The current Kit (the one documented here) will be supported in future releases, but work on this Kit has stopped. Look for a new Media Kit in BeOS Release 4.

The Media Kit gives you tools that let you generate, examine, manipulate, and realize (or render) sound data in real-time. It's based on the notion of subscribers that talk to the system wide audio server:

At the subscriber layer, the Kit provides three classes:

The Kit also provides a BSoundFile class that lets you read from and write to sound files, and global functions that let you play sound files.


Sound Hardware

The sound hardware consists of a number of physical devices (jacks, converters, and the like), a signal path that routes audio data between these devices, and "control points" along the signal path that let you adjust the format and flow of the audio data. These elements are depicted in the following illustration.

Inputs

There are three analog audio input devices:

Note that the microphone signal doesn't have a through path.

To bring an analog signal into your application (so you can record it, for example), the signal must pass through the input MUX:

Converters

There are two sound data converters, the analog-to-digital converter (ADC) and the digital-to-analog converter (DAC):

The ADC takes the analog signal that it reads from the MUX and converts it to digital representation. It does this by producing a series of samples, or instantaneous measurements of the signal's amplitude. The ADC control point is called B_ADC_IN.

The DAC converts digital sound data into a continuous analog signal. The DAC control point is called B_DAC_OUT.

Acting as a sort of "short-circuit" between these two devices is the loopback:

Streams

The ADC stream and DAC stream are represented in the Media Kit by the BADCStream and BDACStream classes. By subscribing to the ADC stream you can receive the samples that are emitted by the ADC; and by subscribing to the DAC stream, you can send buffers of digital sound data to the DAC.

The process of subscribing to a stream is described in the BSubscriber class.

Outputs

The output devices take analog signals and broadcast them to hardware that can turn the signals into sound.






The Be Book, in lovely HTML, for BeOS Release 3.

Copyright © 1998 Be, Inc. All rights reserved.

Last modified March 26, 1998.