Beispiel #1
0
 static extern int BASS_Encode_OGG_Start(int Handle, string Options, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User);
Beispiel #2
0
 /// <summary>
 /// Start Ogg Encoding to <see cref="EncodeProcedure"/>.
 /// </summary>
 /// <param name="Handle">The channel handle... a HSTREAM, HMUSIC, or HRECORD.</param>
 /// <param name="Options">
 /// Encoder options... null = use defaults.
 /// The following OGGENC style options are supported: -b / --bitrate, -m / --min-bitrate, -M / --max-bitrate, -q / --quality, -s / --serial, -t / --title, -a / --artist, -G / --genre, -d / --date, -l / --album, -N / --tracknum, -c / --comment.
 /// Anything else that is included will be ignored.
 /// </param>
 /// <param name="Flags">A combination of <see cref="EncodeFlags"/>.</param>
 /// <param name="Procedure">Optional callback function to receive the encoded data... null = no callback.</param>
 /// <param name="User">User instance data to pass to the callback function.</param>
 /// <returns>The encoder handle is returned if the encoder is successfully started, else 0 is returned. Use <see cref="Bass.LastError"/> to get the error code</returns>
 /// <remarks>
 /// <see cref="BassEnc.EncodeStart(int,string,EncodeFlags,EncoderProcedure,IntPtr)"/> is used internally to apply the encoder to the source channel, so the remarks in its documentation also apply to this function.
 ///
 /// <b>Platform-specific</b>
 /// Ogg Vorbis encoding involves extensive floating-point operations, so it is not supported on platforms/architectures that do not have an FPU, eg. older ARM platforms/architectures.
 /// </remarks>
 /// <exception cref="Errors.Handle"><paramref name="Handle"/> is not valid</exception>
 /// <exception cref="Errors.SampleFormat">The channel's sample format is not supported by the encoder.</exception>
 /// <exception cref="Errors.NotAvailable">This function is not available on platforms/architectures without an FPU.</exception>
 /// <exception cref="Errors.Unknown">Some other mystery problem! </exception>
 public static int Start(int Handle, string Options, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User)
 {
     return(BASS_Encode_OGG_Start(Handle, Options, Flags | EncodeFlags.Unicode, Procedure, User));
 }
Beispiel #3
0
 /// <summary>
 /// Starts encoding on a channel.
 /// </summary>
 /// <param name="Handle">The channel Handle... a HSTREAM, HMUSIC, or HRECORD.</param>
 /// <param name="CommandLine">The encoder command-line, including the executable filename and any options. Or the output filename if the <see cref="EncodeFlags.PCM"/> flag is specified.</param>
 /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param>
 /// <param name="Procedure">Optional callback function to receive the encoded data... <see langword="null" /> = no callback. To have the encoded data received by a callback function, the encoder needs to be told to output to STDOUT (instead of a file).</param>
 /// <param name="User">User instance data to Password to the callback function.</param>
 /// <param name="Limit">The maximum number of bytes that will be encoded (0 = no limit).</param>
 /// <returns>The encoder process Handle is returned if the encoder is successfully started, else 0 is returned (use <see cref="Bass.LastError" /> to get the error code).</returns>
 /// <remarks>
 /// <para>
 /// This function works exactly like <see cref="EncodeStart(int,string,EncodeFlags,EncodeProcedure,IntPtr)" />, but with a <paramref name="Limit" /> parameter added, which is the maximum number of bytes that will be encoded (0=no limit).
 /// Once the limit is hit, the encoder will die.
 /// <see cref="EncodeSetNotify" /> can be used to be notified of that occurrence.
 /// One thing to note is that the limit is applied after any conversion due to the floating-point flags.
 /// </para>
 /// <para>This can be useful in situations where the encoder needs to know in advance how much data it will be receiving. For example, when using a callback function with a file format that stores the length in the header, as the header cannot then be updated at the end of encoding. The length is communicated to the encoder via the WAVE header, so it requires that the BASS_ENCODE_NOHEAD flag is not used.</para>
 /// <para>
 /// The encoder must be told (via the command-line) to expect input from STDIN, rather than a file.
 /// The command-line should also tell the encoder what filename to write it's output to, unless you're using a callback function, in which case it should be told to write it's output to STDOUT.
 /// </para>
 /// <para>
 /// No user interaction with the encoder is possible, so anything that would cause the encoder to require the user to press any keys should be avoided.
 /// For example, if the encoder asks whether to overwrite files, the encoder should be instructed to always overwrite (via the command-line), or you should delete the existing file before starting the encoder.
 /// </para>
 /// <para>
 /// Standard RIFF files are limited to a little over 4GB in size.
 /// When writing a WAV file, BASSenc will automatically stop at that point, so that the file is valid.
 /// That does not apply when sending data to an encoder though, as the encoder may (possibly via a command-line option) ignore the size restriction, but if it does not, it could mean that the encoder stops after a few hours (depending on the sample format).
 /// If longer encodings are needed, the <see cref="EncodeFlags.NoHeader"/> flag can be used to omit the WAVE header, and the encoder informed of the sample format via the command-line instead.
 /// The 4GB size limit can also be overcome with the <see cref="EncodeFlags.RF64"/> flag, but most encoders are unlikely to support RF64.
 /// </para>
 /// <para>
 /// When writing an RF64 WAV file, a standard RIFF header will still be written initially, which will only be replaced by an RF64 header at the end if the file size has exceeded the standard limit.
 /// When an encoder is used, it is not possible to go back and change the header at the end, so the RF64 header is sent at the beginning in that case.
 /// </para>
 /// <para>
 /// Internally, the sending of sample data to the encoder is implemented via a DSP callback on the channel.
 /// That means when you play the channel (or call <see cref="Bass.ChannelGetData(int,IntPtr,int)" /> if it's a decoding channel), the sample data will be sent to the encoder at the same time.
 /// It also means that if you use the <see cref="Bass.FloatingPointDSP"/> option, then the sample data will be 32-bit floating-point, and you'll need to use one of the Floating-point flags if the encoder does not support floating-point sample data.
 /// The <see cref="Bass.FloatingPointDSP"/> setting should not be changed while encoding is in progress.
 /// </para>
 /// <para>The encoder DSP has a priority setting of -1000, so if you want to set DSP/FX on the channel and have them present in the encoding, set their priority above that.</para>
 /// <para>
 /// Besides the automatic DSP system, data can also be manually fed to the encoder via the <see cref="EncodeWrite(int,IntPtr,int)" /> function.
 /// Both methods can be used together, but in general, the "automatic" system ought be paused when using the "manual" system, by use of the <see cref="EncodeFlags.Pause"/> flag or the <see cref="EncodeSetPaused" /> function.
 /// </para>
 /// <para>
 /// When queued encoding is enabled via the <see cref="EncodeFlags.Queue"/> flag, the DSP system or <see cref="EncodeWrite(int,IntPtr,int)" /> call will just buffer the data, and the data will then be fed to the encoder by another thread.
 /// The buffer will grow as needed to hold the queued data, up to a limit specified by the <see cref="Queue"/> config option.
 /// If the limit is exceeded (or there is no free memory), data will be lost; <see cref="EncodeSetNotify(int,EncodeNotifyProcedure,IntPtr)" /> can be used to be notified of that occurrence.
 /// The amount of data that is currently queued, as well as the queue limit and how much data has been lost, is available from <see cref="EncodeGetCount(int,EncodeCount)" />.
 /// </para>
 /// <para>
 /// <see cref="EncodeIsActive" /> can be used to check that the encoder is still running.
 /// When done encoding, use <see cref="EncodeStop(int)" /> to close the encoder.
 /// </para>
 /// <para>The returned process Handle can be used to do things like change the encoder's priority and get it's exit code.</para>
 /// <para>
 /// Multiple encoders can be set on a channel.
 /// For simplicity, the encoder functions will accept either an encoder Handle or a channel Handle.
 /// When using a channel Handle, the function is applied to all encoders that are set on that channel.
 /// </para>
 /// <para><b>Platform-specific</b></para>
 /// <para>External encoders are not supported on iOS or Windows CE, so only plain PCM file writing with the <see cref="EncodeFlags.PCM"/> flag is possible on those platforms.</para>
 /// </remarks>
 /// <exception cref="Errors.Handle"><paramref name="Handle" /> is not valid.</exception>
 /// <exception cref="Errors.FileOpen">Couldn't start the encoder. Check that the executable exists.</exception>
 /// <exception cref="Errors.Create">The PCM file couldn't be created.</exception>
 /// <exception cref="Errors.Unknown">Some other mystery problem!</exception>
 public static int EncodeStart(int Handle, string CommandLine, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User, int Limit)
 {
     return(BASS_Encode_StartLimit(Handle, CommandLine, Flags | EncodeFlags.Unicode, Procedure, User, Limit));
 }
Beispiel #4
0
 static extern int BASS_Encode_StartLimit(int handle, string cmdline, EncodeFlags flags, EncodeProcedure proc, IntPtr user, int limit);
Beispiel #5
0
 public static extern int EncodeStartACM(int Handle, IntPtr Format, EncodeFlags Flags, EncodeProcedure Procedure, IntPtr User = default(IntPtr));
Beispiel #6
0
 public static extern int EncodeStart(int handle, [MarshalAs(UnmanagedType.LPStr)] string cmdline, BassFlags flags, EncodeProcedure proc, IntPtr user, int limit);
Beispiel #7
0
 public static extern int EncodeStartACM(int handle, IntPtr form, EncodeFlags flags, EncodeProcedure proc, IntPtr user);