Unified · Split
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-01-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | ||
| 2 | |||
| 3 | * doc/api.html doc/api_callback.html doc/api_misc.html | ||
| 4 | Update docs to make handling of interleaved data more explicit. | ||
| 5 | |||
| 1 | 2006-07-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | 6 | 2006-07-26 Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 2 | 7 | ||
| 3 | * examples/audio_out.c | 8 | * examples/audio_out.c |
| @@ -88,8 +88,14 @@ The API allows three methods for accessing the capabilies of the library: · 87 unmodified lines | |||
| 88 | This interface is particularly well suited to applications where the output | 88 | This interface is particularly well suited to applications where the output |
| 89 | sample rate is varied with time. | 89 | sample rate is varied with time. |
| 90 | </UL> | 90 | </UL> |
| 91 | |||
| 92 | <P> | ||
| 93 | <b>NB :</b> All three access methods are able to process multi channel interleaved | ||
| 94 | data. | ||
| 95 | </P> | ||
| 96 | |||
| 91 | <P> | 97 | <P> |
| 92 | The parts of the API which are common to both are: | 98 | The parts of the API which are common to all three interfaces are: |
| 93 | </P> | 99 | </P> |
| 94 | <UL> | 100 | <UL> |
| 95 | <LI> The <A HREF="api_misc.html#ErrorReporting">error reporting</A> mechanisim. | 101 | <LI> The <A HREF="api_misc.html#ErrorReporting">error reporting</A> mechanisim. |
| @@ -119,12 +125,3 @@ distribution contain numerous example programs showing the use of the library. · 23 unmodified lines | |||
| 119 | 125 | ||
| 120 | </BODY> | 126 | </BODY> |
| 121 | </HTML> | 127 | </HTML> |
| 122 | |||
| 123 | <!-- | ||
| 124 | Do not edit or modify anything in this comment block. | ||
| 125 | The arch-tag line is a file identity tag for the GNU Arch | ||
| 126 | revision control system. | ||
| 127 | |||
| 128 | arch-tag: d1c3051e-f026-48e1-b72c-ff1dd8503272 | ||
| 129 | --> | ||
| 130 | |||
| @@ -73,6 +73,15 @@ The callback API consists of the following functions : · 72 unmodified lines | |||
| 73 | int <A HREF="api_full.html#SetRatio">src_set_ratio</A> (SRC_STATE *state, double new_ratio) ; | 73 | int <A HREF="api_full.html#SetRatio">src_set_ratio</A> (SRC_STATE *state, double new_ratio) ; |
| 74 | </PRE> | 74 | </PRE> |
| 75 | <BR> | 75 | <BR> |
| 76 | |||
| 77 | <P> | ||
| 78 | Like the | ||
| 79 | <A HREF="api_simple.html">simple API</a> | ||
| 80 | and the | ||
| 81 | <A HREF="api_full.html">full API</a>, | ||
| 82 | the callback based API is able to operate on interleaved multi channel data. | ||
| 83 | </P> | ||
| 84 | |||
| 76 | <P> | 85 | <P> |
| 77 | An example of the use of the callback based API can be found in the | 86 | An example of the use of the callback based API can be found in the |
| 78 | <B>varispeed-play</B> program in the <B>examples/</B> directory of the | 87 | <B>varispeed-play</B> program in the <B>examples/</B> directory of the |
| @@ -127,10 +136,11 @@ function to pull data out of the converter. · 48 unmodified lines | |||
| 127 | long frames, float *data) ; | 136 | long frames, float *data) ; |
| 128 | </PRE> | 137 | </PRE> |
| 129 | <P> | 138 | <P> |
| 130 | The <B>src_callback_read</B> function is passed the <B>SRC_STATE</B> pointer | 139 | The <B>src_callback_read</B> function is passed the |
| 131 | returned by <B>src_callback_new</B>, the coversion ratio (output_sample_rate | 140 | <A HREF="api_misc.html#SRC_DATA"><B>SRC_STATE</B></A> |
| 132 | / input_sample_rate), the maximum number of output frames to generate and a | 141 | pointer returned by <B>src_callback_new</B>, the coversion ratio |
| 133 | pointer to a buffer in which to place the output data. | 142 | (output_sample_rate / input_sample_rate), the maximum number of output frames |
| 143 | to generate and a pointer to a buffer in which to place the output data. | ||
| 134 | </P> | 144 | </P> |
| 135 | <P> | 145 | <P> |
| 136 | The <B>src_callback_read</B> function returns the number of frames generated | 146 | The <B>src_callback_read</B> function returns the number of frames generated |
| @@ -149,11 +159,3 @@ src_error</A> will return non-zero. · 12 unmodified lines | |||
| 149 | </BODY> | 159 | </BODY> |
| 150 | </HTML> | 160 | </HTML> |
| 151 | 161 | ||
| 152 | <!-- | ||
| 153 | Do not edit or modify anything in this comment block. | ||
| 154 | The arch-tag line is a file identity tag for the GNU Arch | ||
| 155 | revision control system. | ||
| 156 | |||
| 157 | arch-tag: c80cf67e-b7a1-4701-a608-a1718c5aa57d | ||
| 158 | --> | ||
| 159 | |||
| @@ -161,14 +161,16 @@ This struct is defined as: · 160 unmodified lines | |||
| 161 | The <B>data_in</B> pointer is used to pass audio data into the converter while the | 161 | The <B>data_in</B> pointer is used to pass audio data into the converter while the |
| 162 | <B>data_out</B> pointer supplies the converter with an array to hold the converter's | 162 | <B>data_out</B> pointer supplies the converter with an array to hold the converter's |
| 163 | output. | 163 | output. |
| 164 | For a converter which has been configured for mulitchannel operation, these pointers | ||
| 165 | need to point to a single array of interleaved data. | ||
| 164 | </P> | 166 | </P> |
| 165 | <P> | 167 | <P> |
| 166 | The <B>input_frames</B> and <B>output_frames</B> fields supply the converter with | 168 | The <B>input_frames</B> and <B>output_frames</B> fields supply the converter with |
| 167 | the lengths of the arrays pointed to by the <B>data_in</B> and <b>data_out</B> | 169 | the lengths of the arrays (in frames) pointed to by the <B>data_in</B> and |
| 168 | pointers respectively. | 170 | <b>data_out</B> pointers respectively. |
| 169 | For monophinc data, these values would indicate the length of the arrays while | 171 | For monophinc data, these values would indicate the length of the arrays while |
| 170 | for stereo data these values would be equal to the half the length of the array | 172 | for multi channel data these values would be equal to the the length of the array |
| 171 | and so on. | 173 | divided by the number of channels. |
| 172 | </P> | 174 | </P> |
| 173 | 175 | ||
| 174 | <P> | 176 | <P> |