public BassStream(IBassStreamProvider provider, int channelHandle, long length, IEnumerable <IBassStreamAdvice> advice, BassFlags flags) : this() { this.Provider = provider; this.ChannelHandle = channelHandle; this.Length = length; this.Advice = advice; this.Flags = flags; }
/// <summary>Create a stream from file.</summary> public static int CreateStream(string File, long Offset = 0, long Length = 0, BassFlags Flags = BassFlags.Default) { return(BASS_MPC_StreamCreateFile(false, File, Offset, Length, Flags | BassFlags.Unicode)); }
/// <summary>Create a stream from Memory (byte[]).</summary> public static int CreateStream(byte[] Memory, long Offset, long Length, BassFlags Flags) { return(GCPin.CreateStreamHelper(Pointer => CreateStream(Pointer, Offset, Length, Flags), Memory)); }
static extern IntPtr BASS_WMA_GetTags(string File, BassFlags Flags = BassFlags.Unicode);
static extern int BASS_OFR_StreamCreateURL(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User);
public static extern int ReverseCreate(int Channel, float DecodingBlockLength, BassFlags Flags);
/// <summary> /// Streams a WMA file authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>. /// </summary> public static int CreateStream(string File, BassFlags Flags, string UserName, string Password) { return(BASS_WMA_StreamCreateFileAuth(false, File, 0, 0, Flags | BassFlags.Unicode, UserName, Password)); }
public static extern int CreateStream(int Drive, int Track, BassFlags Flags);
static extern int BASS_CD_StreamCreateEx(int Drive, int Track, BassFlags Flags, CDDataProcedure proc, IntPtr user);
static extern int BASS_RecordStart(int freq, int chans, BassFlags flags, RecordProcedure proc, IntPtr User);
public override bool Wrap(IBassStreamProvider provider, int channelHandle, IEnumerable <IBassStreamAdvice> advice, BassFlags flags, out IBassStream stream) { var offset = default(long); var length = default(long); if (this.Offset != TimeSpan.Zero) { offset = Bass.ChannelSeconds2Bytes(channelHandle, this.Offset.TotalSeconds); } if (this.Length != TimeSpan.Zero) { length = Bass.ChannelSeconds2Bytes(channelHandle, this.Length.TotalSeconds); } if (offset != 0 || length != 0) { if (length == 0) { length = Bass.ChannelGetLength(channelHandle, PositionFlags.Bytes) - offset; } stream = new BassStream( provider, BassSubstream.CreateStream(channelHandle, offset, length, flags), length, advice, flags ); return(true); } stream = null; return(false); }
/// <summary> /// Starts recording. /// </summary> /// <param name="Frequency">The sample rate to record at.</param> /// <param name="Channels">The number of channels... 1 = mono, 2 = stereo.</param> /// <param name="Flags">Any combination of <see cref="BassFlags.Byte"/>, <see cref="BassFlags.Float"/> and <see cref="BassFlags.RecordPause"/>.</param> /// <param name="Period"> /// Set the period (in milliseconds) between calls to the callback function (<see cref="RecordProcedure" />). /// The minimum period is 5ms, the maximum the maximum is half the <see cref="RecordingBufferLength"/> setting. /// If the period specified is outside this range, it is automatically capped. The default is 100ms. /// </param> /// <param name="Procedure">The user defined function to receive the recorded sample data... can be <see langword="null" /> if you do not wish to use a callback.</param> /// <param name="User">User instance data to pass to the callback function.</param> /// <returns>If successful, the new recording's handle is returned, else <see langword="false" /> is returned. Use <see cref="LastError"/> to get the error code.</returns> /// <exception cref="Errors.Init"><see cref="RecordInit" /> has not been successfully called.</exception> /// <exception cref="Errors.Busy"> /// The device is busy. /// An existing recording must be stopped before starting another one. /// Multiple simultaneous recordings can be made from the same device on Windows XP and Vista, but generally not on older Windows. /// </exception> /// <exception cref="Errors.NotAvailable"> /// The recording device is not available. /// Another application may already be recording with it, or it could be a half-duplex device and is currently being used for playback. /// </exception> /// <exception cref="Errors.SampleFormat"> /// The specified format is not supported. /// If using the <see cref="BassFlags.Float"/> flag, it could be that floating-point recording is not supported. /// </exception> /// <exception cref="Errors.Memory">There is insufficient memory.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static int RecordStart(int Frequency, int Channels, BassFlags Flags, int Period, RecordProcedure Procedure, IntPtr User = default(IntPtr)) { return(RecordStart(Frequency, Channels, (BassFlags)BitHelper.MakeLong((short)Flags, (short)Period), Procedure, User)); }
static extern int BASS_ZIPSTREAM_StreamCreateFile(bool mem, string file, int index, long offset, long length, BassFlags flags);
[DllImport(DllName, EntryPoint = "BASS_WINAMP_StreamCreate")] // Winamp only supports ASCII filenames. public static extern int CreateStream(string FileName, BassFlags Flags);
public static extern bool BPMBeatDecodeGet(int Channel, double StartSec, double EndSec, BassFlags Flags, BPMBeatProcedure Procedure, IntPtr User = default(IntPtr));
static extern int BASS_CD_StreamCreateFile(string File, BassFlags Flags);
public static extern int TempoCreate(int Channel, BassFlags Flags);
/// <summary> /// Creates a sample stream from an audio CD track, using a CDA file on the CD. /// </summary> /// <param name="File">The CDA filename... for example, "D:\Track01.cda".</param> /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param> /// <returns>If successful, the new stream's handle is returned, else 0 is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <remarks> /// <para> /// Only one stream can exist at a time per CD drive. /// If a stream using the drive already exists, this function will fail, unless the <see cref="FreeOld"/> config option is enabled. /// Note that <see cref="StreamSetTrack" /> can be used to change track without creating a new stream. /// </para> /// <para> /// The sample format of a CD audio stream is always 44100hz stereo 16-bit, unless the <see cref="BassFlags.Float"/> flag is used, in which case it's converted to 32-bit. /// When reading sub-channel data, the sample rate will be 45900hz, taking the additional sub-channel data into account. /// </para> /// <para> /// When reading sub-channel data, BASSCD will automatically de-interleave the data if the drive can't. /// You can check whether the drive can de-interleave the data itself (or even read sub-channel data at all) in the the <see cref="CDInfo.ReadWriteFlags"/> member. /// </para> /// <para> /// When using the <see cref="BassFlags.Decode"/> flag, it's not possible to play the stream, but seeking is still possible. /// Because the decoded sample data is not outputted, "decoding channels" can still be used when there is no output device (using the <see cref="Bass.NoSoundDevice"/> device with <see cref="Bass.Init" />). /// </para> /// </remarks> /// <exception cref="Errors.Init"><see cref="Bass.Init" /> has not been successfully called.</exception> /// <exception cref="Errors.Already">A stream using this drive already exists.</exception> /// <exception cref="Errors.FileOpen">The file could not be opened.</exception> /// <exception cref="Errors.FileFormat">The file was not recognised as a CDA file.</exception> /// <exception cref="Errors.Parameter">The <see cref="BassFlags.CDSubChannel"/> and <see cref="BassFlags.CdC2Errors"/> flags cannot be used without the <see cref="BassFlags.Decode"/> flag or with the <see cref="BassFlags.Float"/> flag. See <see cref="CreateStream(string,BassFlags,CDDataProcedure,IntPtr)" />.</exception> /// <exception cref="Errors.NoCD">There's no CD in the drive.</exception> /// <exception cref="Errors.NotAudioTrack">The track is not an audio track.</exception> /// <exception cref="Errors.NotAvailable">Reading sub-channel data and/or C2 error info is not supported by the drive, or a read offset is in effect. In case of the latter, see <see cref="CreateStream(string,BassFlags,CDDataProcedure,IntPtr)" />.</exception> /// <exception cref="Errors.SampleFormat">The sample format is not supported by the device/drivers. If using the <see cref="BassFlags.Float"/> flag, it could be that floating-point channels are not supported (ie. no WDM drivers).</exception> /// <exception cref="Errors.Speaker">The device/drivers do not support the requested speaker(s), or you're attempting to assign a stereo stream to a mono speaker.</exception> /// <exception cref="Errors.Memory">There is insufficient memory.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static int CreateStream(string File, BassFlags Flags) { return(BASS_CD_StreamCreateFile(File, Flags | BassFlags.Unicode)); }
static extern int BASS_WMA_StreamCreateFileAuth(bool mem, string file, long offset, long length, BassFlags flags, string user, string pass);
static extern int BASS_CD_StreamCreateFileEx(string File, BassFlags Flags, CDDataProcedure proc, IntPtr user = default(IntPtr));
/// <summary> /// Streams a WMA file from Memory (<see cref="IntPtr"/>) authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>. /// </summary> public static int CreateStream(IntPtr Memory, long Length, BassFlags Flags, string UserName, string Password) { return(BASS_WMA_StreamCreateFileAuth(true, Memory, 0, Length, Flags | BassFlags.Unicode, UserName, Password)); }
/// <summary> /// Creates a new BASS stream based on any VST instrument plugin (VSTi). /// </summary> /// <param name="Frequency">The sample rate of the VSTi output (e.g. 44100).</param> /// <param name="Channels">The number of channels... 1 = mono, 2 = stereo, 4 = quadraphonic, 6 = 5.1, 8 = 7.1.</param> /// <param name="DllFile">The fully qualified path and file name to the VSTi plugin (a DLL file name).</param> /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param> /// <returns>If successful, the new vst handle is returned, else 0 is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <remarks> /// On success, the function returns the new vstHandle that must be given to the other functions. /// The returned VST handle can also be given to the typical Bass.Channel* functions. /// Use <see cref="ChannelFree" /> to delete and free a VST instrument channel. /// </remarks> public static int ChannelCreate(int Frequency, int Channels, string DllFile, BassFlags Flags) { return(BASS_VST_ChannelCreate(Frequency, Channels, DllFile, Flags | BassFlags.Unicode)); }
static extern int BASS_OFR_StreamCreateFile(bool mem, string file, long offset, long length, BassFlags flags);
static extern int BASS_VST_ChannelCreate(int Frequency, int Channels, string DllFile, BassFlags Flags);
static extern int BASS_MPC_StreamCreateFile(bool mem, IntPtr file, long offset, long length, BassFlags flags);
public static extern float BPMDecodeGet(int Channel, double StartSec, double EndSec, int MinMaxBPM, BassFlags Flags, BPMProgressProcedure Procedure, IntPtr User = default(IntPtr));
/// <summary>Create a stream from Memory (IntPtr).</summary> public static int CreateStream(IntPtr Memory, long Offset, long Length, BassFlags Flags = BassFlags.Default) { return(BASS_MPC_StreamCreateFile(true, new IntPtr(Memory.ToInt64() + Offset), 0, Length, Flags)); }
public static extern bool BPMCallbackSet(int Handle, BPMProcedure Procedure, double Period, int MinMaxBPM, BassFlags Flags, IntPtr User = default(IntPtr));
static extern int BASS_MPC_StreamCreateFileUser(StreamSystem system, BassFlags flags, [In, Out] FileProcedures procs, IntPtr user);
/// <summary> /// Streams a WMA file from Memory (byte[]) authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>. /// </summary> public static int CreateStream(byte[] Memory, long Length, BassFlags Flags, string UserName, string Password) { return(GCPin.CreateStreamHelper(Pointer => CreateStream(Pointer, Length, Flags, UserName, Password), Memory)); }