mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 04:24:48 +00:00
b586eafd3b
LINE INPUT will now use the faster method if passed a file handle that has been opened FOR BINARY. As such, the _BLINEINPUT command has been removed. qb64.bas now takes advantage of this for reading from '$include files, at least in Include Manager 1. Some tweaking of internal/source/main.txt was required to get things into a sane state, so I'm holing off changing the compiler any further so the auto-builder can make sure everything's smoothed over. Note: Everything should still compile as normal; I'm just being overcautious.
140 lines
No EOL
5.3 KiB
HTML
140 lines
No EOL
5.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head>
|
|
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
|
<title>
|
|
Secret Rabbit Code (aka libsamplerate)
|
|
</title>
|
|
<meta name="Author" content="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
|
<meta name="Version" content="libsamplerate-0.1.8">
|
|
<meta name="Description" content="The Secret Rabbit Code Home Page">
|
|
<meta name="Keywords" content="libsamplerate sound resample audio dsp Linux">
|
|
<link rel="StyleSheet" href="api_simple_files/SRC.css" type="text/css" media="all">
|
|
</head>
|
|
|
|
<body alink="#FB1465" bgcolor="#000000" link="#FB1465" text="#FFFFFF" vlink="#FB1465">
|
|
<!-- <A HREF="mailto:waistcoats.tortillas@wednesday.net.cn">waistcoats.tortillas</A> -->
|
|
<center>
|
|
<img src="api_simple_files/SRC.png" alt="SRC.png" height="100" width="760">
|
|
</center>
|
|
<!-- <A HREF="mailto:brontosaurus.dynamo@fail.org.sg">brontosaurus.dynamo</A> -->
|
|
<br>
|
|
<!-- <A HREF="mailto:disowned.Hokusai@eyed.net.tw">disowned.Hokusai</A> -->
|
|
<table align="center" width="98%">
|
|
<tbody><tr>
|
|
<td valign="top">
|
|
<br>
|
|
<div class="nav">
|
|
<br>
|
|
<a href="http://www.mega-nerd.com/SRC/index.html">Home</a><br>
|
|
<br>
|
|
<a href="http://www.mega-nerd.com/SRC/api_simple.html">Simple API</a><br>
|
|
<a href="http://www.mega-nerd.com/SRC/api_full.html">Full API</a><br>
|
|
<a href="http://www.mega-nerd.com/SRC/api_callback.html">Callback API</a><br>
|
|
<a href="http://www.mega-nerd.com/SRC/api_misc.html">Miscellaneous</a><br>
|
|
<a href="http://www.mega-nerd.com/SRC/api_misc.html#ErrorReporting">Error Handling</a><br>
|
|
<br>
|
|
<div class="block">
|
|
Author :<br>Erik de Castro Lopo
|
|
<!-- <A HREF="mailto:vulva@inflame-toughly.org">vulva</A> -->
|
|
<br><br>
|
|
<!-- <A HREF="mailto:Twitter.reenforce@conflicted.com.cn">Twitter.reenforce</A> -->
|
|
|
|
</div>
|
|
<img src="api_simple_files/Count.gif" alt="counter.gif" height="30" width="100">
|
|
</div>
|
|
|
|
</td>
|
|
<!-- <A HREF="mailto:foregathering.Gupta@qiqihar.net.ru">foregathering.Gupta</A> -->
|
|
<!-- ######################################################################## -->
|
|
<!-- <A HREF="mailto:salute.harped@hankie.net.ru">salute.harped</A> -->
|
|
<td valign="top">
|
|
<div class="block">
|
|
|
|
<h1><b>Simple API</b></h1>
|
|
|
|
<p>
|
|
<b>Important Note:</b>
|
|
The simple API is not designed to work on small chunks of a larger piece of
|
|
audio.
|
|
If you attempt to use it this way you are doing it wrong and will not get the
|
|
results you want.
|
|
For processing audio data in chunks you <b>must</b> use the
|
|
<a href="http://www.mega-nerd.com/SRC/api_full.html">full api</a>
|
|
or the
|
|
<a href="http://www.mega-nerd.com/SRC/api_callback.html">callback based api</a>.
|
|
</p>
|
|
|
|
<br><br>
|
|
|
|
<p>
|
|
The simple API consists of a single function :
|
|
</p>
|
|
<pre> int src_simple (SRC_DATA *data, int converter_type, int channels) ;
|
|
</pre>
|
|
<p>
|
|
The use of this function rather than the more fully featured API requires the caller
|
|
to know the total length of the input data before hand and that all input and output
|
|
data can be held in the system's memory at once.
|
|
It also assumes that there is a single constant ratio between input and output sample
|
|
rates.
|
|
<!--
|
|
If these conditions cannot be met, the full featured API should be used instead.
|
|
In addition, this documentation is complemented by this
|
|
<A HREF="ex_simple.html">example code</A>. -->
|
|
</p>
|
|
|
|
<p>
|
|
Dealing with the easy stuff first, the <b>converter_type</b> parameter should be
|
|
one of the values defined in <b>samplerate.h</b> and documented
|
|
<a href="http://www.mega-nerd.com/SRC/api_misc.html#Converters">here</a> while the <b>channels</b> parameter
|
|
specifies the number of interleaved channels that the sample rate converter
|
|
is being asked to process (number of input channels and output channels is always
|
|
equal).
|
|
There is no hard upper limit on the number of channels; it is limited purely
|
|
by the amount of memory available.
|
|
</p>
|
|
|
|
|
|
<p>
|
|
The first parameter to <b>src_simple</b> is a pointer to an <b>SRC_DATA</b> struct
|
|
(more info <a href="http://www.mega-nerd.com/SRC/api_misc.html#SRC_DATA">here</a>) defined as follows:
|
|
</p>
|
|
<pre> typedef struct
|
|
{ float *data_in, *data_out ;
|
|
|
|
long input_frames, output_frames ;
|
|
long input_frames_used, output_frames_gen ;
|
|
|
|
int end_of_input ;
|
|
|
|
double src_ratio ;
|
|
} SRC_DATA ;
|
|
</pre>
|
|
<p>
|
|
The fields of this struct which must be filled in by the caller are:
|
|
</p>
|
|
<pre> data_in : A pointer to the input data samples.
|
|
input_frames : The number of frames of data pointed to by data_in.
|
|
data_out : A pointer to the output data samples.
|
|
output_frames : Maximum number of frames pointer to by data_out.
|
|
src_ratio : Equal to output_sample_rate / input_sample_rate.
|
|
</pre>
|
|
<p>
|
|
When the <b>src_simple</b> function returns <b>output_frames_gen</b> will be
|
|
set to the number of output frames generated and <b>input_frames_used</b> will
|
|
be set to the number of input frames used to generate the provided number of
|
|
output frames.
|
|
</p>
|
|
<p>
|
|
The <b>src_simple</b> function returns a non-zero value when an error occurs.
|
|
See <a href="http://www.mega-nerd.com/SRC/api_misc.html#ErrorReporting">here</a> for how to convert the error value into
|
|
a text string.
|
|
</p>
|
|
|
|
</div>
|
|
</td></tr>
|
|
</tbody></table>
|
|
|
|
|
|
|
|
</body></html> |