static extern IntPtr sfSoundStream_Create(StartCallbackType OnStart, GetDataCallbackType OnGetData, uint ChannelsCount, uint SampleRate, IntPtr UserData);
static extern IntPtr sfSoundStream_create(GetDataCallbackType OnGetData, SeekCallbackType OnSeek, uint ChannelCount, uint SampleRate, IntPtr UserData);
//////////////////////////////////////////////////////////// /// <summary> /// Set the audio stream parameters, you must call it before Play() /// </summary> /// <param name="sampleRate">Number of channels</param> /// <param name="channelsCount">Sample rate, in samples per second</param> //////////////////////////////////////////////////////////// protected void Initialize(uint channelsCount, uint sampleRate) { myStartCallback = new StartCallbackType(Start); myGetDataCallback = new GetDataCallbackType(GetData); SetThis(sfSoundStream_Create(myStartCallback, myGetDataCallback, channelsCount, sampleRate, IntPtr.Zero)); }
//////////////////////////////////////////////////////////// /// <summary> /// Set the audio stream parameters, you must call it before Play() /// </summary> /// <param name="channelCount">Number of channels</param> /// <param name="sampleRate">Sample rate, in samples per second</param> //////////////////////////////////////////////////////////// protected void Initialize(uint channelCount, uint sampleRate) { myGetDataCallback = new GetDataCallbackType(GetData); mySeekCallback = new SeekCallbackType(Seek); SetThis(sfSoundStream_create(myGetDataCallback, mySeekCallback, channelCount, sampleRate, IntPtr.Zero)); }
//////////////////////////////////////////////////////////// /// <summary> /// Set the audio stream parameters, you must call it before Play() /// </summary> /// <param name="channelCount">Number of channels</param> /// <param name="sampleRate">Sample rate, in samples per second</param> //////////////////////////////////////////////////////////// protected void Initialize(uint channelCount, uint sampleRate) { myGetDataCallback = new GetDataCallbackType(GetData); mySeekCallback = new SeekCallbackType(Seek); CPointer = sfSoundStream_create(myGetDataCallback, mySeekCallback, channelCount, sampleRate, IntPtr.Zero); }
/// <summary> /// Sets the audio stream parameters, you must call it before calling <see cref="Play"/>. /// </summary> /// <param name="channelCount">Number of channels.</param> /// <param name="sampleRate">Sample rate, in samples per second.</param> protected void Initialize(uint channelCount, uint sampleRate) { _getDataCallback = new GetDataCallbackType(GetData); _seekCallback = new SeekCallbackType(Seek); CPointer = sfSoundStream_create(_getDataCallback, _seekCallback, channelCount, sampleRate, IntPtr.Zero); }