<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="sfrecord~" module="msp" category="MSP I/O">
	<digest>
		Record to audio file on disk
	</digest>
	<description>
		Use the <o>sfrecord~</o> object to record and save MSP output as an audio file.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP I/O
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Record Ch 1, 1/0 Record On/Off
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
				(signal) Record Ch 2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) elapsed time (ms)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="number-of-input-channels" optional="1" type="int">
			<digest>
				Number of input channels
			</digest>
			<description>
				Sets the number of input channels, which determines the number of inlets that the <o>sfrecord~</o> object will have. The maximum number of channels is 64, and the default is 1. The audio file created will have the same number of channels as this argument. Whether you can actually record the maximum number of channels is dependent on the speed of your processor and hard disk.
			</description>
		</objarg>
		<objarg name="buffer-size" optional="1" type="int">
			<digest>
				Buffer size
			</digest>
			<description>
				An optional second argument sets the buffer size. The defult value is 20160.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="recording-start/stop-flag (0 or nonzero)" optional="0" type="int" />
			</arglist>
			<digest>
				Start/stop recording
			</digest>
			<description>
				In left inlet: If a file has been opened with the <m>open</m> message, a non-zero value begins recording, and <m>0</m> stops recording and closes the file. <o>sfrecord~</o> requires another <m>open</m> message to record again if a <m>0</m> has been sent.
				<br />
				<br />
				Recording may also stop spontaneously if there is an error, such as running out of space on your hard disk.
			</description>
		</method>
		<method name="loop">
			<arglist>
				<arg name="length (milliseconds)" optional="0" type="float" />
			</arglist>
			<digest>
				Start a looping recording
			</digest>
			<description>
				In left inlet: If a file has been opened with the <m>open</m> message, the word <m>loop</m>, followed by a length in milliseconds, begins a recording that captures the most recent audio in the specified amount of time. The recording will stop when the <o>sfrecord~</o> object receives 0 in its left inlet.
			</description>
		</method>
		<method name="open">
			<arglist>
				<arg name="file-type" optional="1" type="symbol" />
				<arg name="filename" optional="1" type="symbol" />
			</arglist>
			<digest>
				Open a file for recording
			</digest>
			<description>
				In left inlet: Opens a file for recording. By default, the file type is AIFF, but <o>sfrecord~</o> also supports WAVE, OGG, FLAC, and Raw Data. The word <m>open</m>, without an argument, brings up a standard Save As dialog allowing you to choose a filename. The optional symbols <m>aiff</m>, <m>wave</m>, <m>ogg</m>, <m>flac</m>, or <m>raw</m> specify the file format (which can also be set in the Save As dialog with a Format pop-up menu). If <m>open</m> is followed by a second symbol, it creates a file in the current default volume. An existing file with the same name will be overwritten. The format symbol (e.g., <m>aiff</m>) can follow the optional filename argument. If only one argument is given to the <m>open</m> message, which is a filename, the file type is determined from the file extension (e.g., &quot;open test.wav&quot; sets the file type to <m>wave</m>).
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Output status information about recording progress
			</digest>
			<description>
				Outputs cryptic status information about the progress of the recording.
			</description>
		</method>
		<method name="record">
			<arglist>
				<arg name="recording-time" optional="0" units="ms" type="float" />
			</arglist>
			<digest>
				Record for a specified amount of time
			</digest>
			<description>
				In left inlet: If a file has been opened with the <m>open</m> message, the word <m>record</m>, followed by a time in milliseconds, begins recording for the specified amount of time. The recording can be stopped before it reaches the end by sending <o>sfrecord~</o> a <m>0</m> to its left inlet.
			</description>
		</method>
		<method name="samptype">
			<arglist>
				<arg name="sample-type" optional="0" type="symbol" />
				<arg name="byte-swap-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Specify the sample type to use when recording
			</digest>
			<description>
				In left inlet: The word <m>samptype</m>, followed by a symbol, specifies the sample type to use when recording the audio file. The following types of sample data are supported:
				<br />
				<br />
				<m>int8</m>: 8-bit integer
				<br />
				<m>int16</m>: 16-bit integer
				<br />
				<m>int24</m>: 24-bit integer
				<br />
				<m>int32</m>: 32-bit integer
				<br />
				<m>float32</m>: 32-bit floating-point
				<br />
				<m>float64</m>: 64-bit floating-point
				<br />
				<m>mulaw</m>: 8-bit &quot;mu&quot;-law encoding
				<br />
				<m>alaw</m>: 8-bit a-law encoding
				<br />
				The optional second argument, a 0 or 1, specifies whether or not byte-swapping should be used, which is only useful when writing a 'raw' audio file.
				<br />
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Signal to be recorded
			</digest>
			<description>
				Each inlet of <o>sfrecord~</o> accepts a signal which is recorded to a channel of an audio file when recording is turned on.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="bitdepth" get="1" set="1" type="int" size="1">
			<digest>
				Bits Per Sample
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Bits Per Sample" />
			</attributelist>
		</attribute>
		<attribute name="dither" get="1" set="1" type="int" size="1">
			<digest>
				Dither PCM Output
			</digest>
			<description>
				Enable triangular dithering when writing PCM (integer) files.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Off">
							<digest>
								Apply no dithering when writing PCM files
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Dither">
							<digest>
								Apply triangular dither (TPDF) when writing PCM files
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Dither + Noise Shaping">
							<digest>
								Apply triangular dither (TPDF) with noise shaping when writing PCM files
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Dither PCM Output" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="nchans" get="1" set="1" type="int" size="1">
			<digest>
				Sets the number of channels to record
			</digest>
			<description>
				Sets the number of channels for the audio file to be recorded (1-64). The default is 1.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Channels" />
			</attributelist>
		</attribute>
		<attribute name="quantization" get="1" set="1" type="int" size="1">
			<digest>
				PCM Quantization Rule
			</digest>
			<description>
				Select the quantization rule when writing PCM (integer) files.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="2">
					<enumlist>
						<enum name="Round">
							<digest>
								Round when quantizing to integer values.
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Floor">
							<digest>
								Floor when quantizing to integer values.
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="PCM Quantization Rule" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="resample" get="1" set="1" type="float" size="1">
			<digest>
				Resample Factor
			</digest>
			<description>
				Upsamples or downsamples the file. Sample rates are expressed as floating-point values - 1.0 is the current sampling rate, 0.5 is half the current, 2.0 is twice the current sample rate, etc.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Resample Factor" />
			</attributelist>
		</attribute>
		<attribute name="sortloop" get="1" set="1" type="int" size="1">
			<digest>
				Save Loop Recording In Order
			</digest>
			<description>
				When the <at>sortloop</at> attribute is on, a recording made with the <m>loop</m> message will be re-ordered so that the beginning of the file is the beginning of the most recent recording. If <at>sortloop</at> is off (default), the beginning of the recording will likely be somewhere in the middle of the resulting audio file.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Save Loop Recording In Order" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="sfrecord~.png" caption="Save an audio file containing 'real world' sound and/or sound created in MSP" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="sfplay~" />
		<seealso name="mc.sfplay~" />
		<seealso name="mc.sfrecord~" />
		<seealso name="07_samplingchapter06" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The time, in milliseconds, since recording of the file began. If recording has stopped, the signal value will remain at the length of the last recording until a new recording is started.
			</description>
		</entry>
	</misc>
</c74object>
