예제 #1
0
 /// <summary>
 /// Decodes the Wave stream into a Signal object.
 /// </summary>
 ///
 /// <param name="index">Audio frame index to start decoding.</param>
 /// <param name="frames">The number of frames to decode.</param>
 ///
 /// <returns>Returns the decoded signal.</returns>
 ///
 public Signal Decode(int index, int frames)
 {
     waveStream.Seek(index * channels, SeekOrigin.Begin);
     return(Decode(frames));
 }
예제 #2
0
 /// <summary>
 ///   Decodes a number of frames into a Signal object, reusing memory from an
 ///   existing signal if possible (that may be overwritten with the new data).
 /// </summary>
 ///
 ///
 /// <param name="index">Audio frame index to start decoding.</param>
 /// <param name="frames">The number of frames to decode.</param>
 /// <param name="signal">The existing audio signal to be overwritten. If set to
 ///   <c>null</c>, a new <see cref="Signal"/> will be created instead.</param>
 ///
 /// <returns>Returns the decoded signal.</returns>
 ///
 /// <remarks>Implementations of this method may throw
 /// <see cref="System.NullReferenceException"/> exception in the case if no audio
 /// stream was opened previously, <see cref="System.ArgumentOutOfRangeException"/> in the
 /// case if stream does not contain frame with specified index or  <see cref="System.ArgumentException"/>
 /// exception to report about incorrectly formatted audio.
 /// </remarks>
 ///
 public Signal Decode(int index, int frames, Signal signal)
 {
     waveStream.Seek(index * numberOfChannels, SeekOrigin.Begin);
     return(Decode(frames: frames, signal: null));
 }