1 <chapter> <title> The audio output layer </title>
3 <sect1> <title> Data exchanges between a decoder and the audio output
7 The audio output basically takes audio samples from one or several
8 FIFOs, mixes and resamples them, and plays them through the audio
9 chip. Data exchanges are simple and described in <filename>
10 src/audio_output/audio_output.c.</filename> A decoder needs to open
11 a channel FIFO with <function> aout_CreateFifo </function>, and
12 then write the data to the buffer. The buffer is in <parameter>
13 p_aout_fifo->buffer + p_aout_fifo->l_end_frame </parameter>
14 * <constant> ADEC_FRAME_SIZE</constant>.
19 <sect1> <title> How to write an audio output plugin </title>
22 [This API is subject to change in the very near future.] Have a look at
23 <filename> plugins/dsp/aout_dsp.c</filename>. You need to write six
29 <listitem> <para> <type> int </type> <function> aout_Probe </function>
30 <parameter> ( probedata_t *p_data ) </parameter> :
31 Returns a score between 0 and 999 to tell whether the plugin
32 can be used. <parameter> p_data </parameter> is currently
36 <listitem> <para> <type> int </type> <function> aout_Open </function>
37 <parameter> ( aout_thread_t *p_aout ) </parameter> :
38 Opens the audio device.
41 <listitem> <para> <type> int </type> <function> aout_SetFormat
42 </function> <parameter> ( aout_thread_t *p_aout ) </parameter> :
43 Sets the output format, the number of channels, and the output
47 <listitem> <para> <type> long </type> <function> aout_GetBufInfo
48 </function> <parameter> ( aout_thread_t *p_aout,
49 long l_buffer_limit ) </parameter> :
50 Gets the status of the audio buffer.
53 <listitem> <para> <function> aout_Play </function> <parameter>
54 ( aout_thread_t *p_aout, byte_t *buffer, int i_size )
56 Writes the audio output buffer to the audio device.
59 <listitem> <para> <function> aout_Close </function> <parameter>
60 ( aout_thread_t *p_aout ) </parameter> :
61 Closes the audio device.