namespace StreamShorts.Library.Media; /// /// Represents a service for processing audio files. /// internal interface IAudioService { /// /// Converts an MP3 stream to a WAV stream with a 16 kHz sample rate. /// /// The input MP3 stream. /// The output WAV stream. /// Thrown when the MP3 stream is null. /// Thrown when the MP3 stream is not readable or seekable. /// The method will preserve the passed MP3 stream's data and position. /// Gets the number of segments in a WAV stream based on the specified segment duration. /// /// param name="wavStream">The input WAV stream. /// The duration of each segment. /// The number of segments. /// Thrown when the WAV stream is null. /// Thrown when the WAV stream is not readable or seekable. /// The method will preserve the passed WAV stream's data and position. int GetNumberOfWavSegments(Stream wavStream, TimeSpan segmentDuration); /// /// Gets a segment of a WAV stream based on the specified segment number and duration. /// /// param name="wavStream">The input WAV stream. /// The segment number to retrieve. /// The duration of each segment. /// The segment stream. /// Thrown when the WAV stream is null. /// Thrown when the WAV stream is not readable or seekable. /// The method will preserve the passed WAV stream's data and position. Stream GetWavSegment(Stream wavStream, int segmentNumber, TimeSpan segmentDuration); }