/// <summary> /// Indicates whether the format converter supports conversion to one /// particular format from another. /// </summary> /// <remarks> /// Indicates whether the format converter supports conversion to one /// particular format from another. /// </remarks> /// <param name="targetFormat">desired format of outgoing data</param> /// <param name="sourceFormat">format of the incoming data</param> /// <returns><code>true</code> if the conversion is supported, otherwise <code>false</code> /// </returns> public virtual bool isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat) { AudioFormat[] targetFormats = getTargetFormats(targetFormat.getEncoding( ), sourceFormat); for (int i = 0; i < targetFormats.Length; i++) { if (targetFormat.matches(targetFormats[i])) { return true; } } return false; }
/// <summary>Indicates whether this data line supports a particular audio format.</summary> /// <remarks> /// Indicates whether this data line supports a particular audio format. /// The default implementation of this method simply returns <code>true</code> if /// the specified format matches any of the supported formats. /// </remarks> /// <param name="format">the audio format for which support is queried.</param> /// <returns><code>true</code> if the format is supported, otherwise <code>false</code> /// </returns> /// <seealso cref="getFormats()">getFormats()</seealso> /// <seealso cref="AudioFormat.matches(AudioFormat)">AudioFormat.matches(AudioFormat) /// </seealso> public virtual bool isFormatSupported(AudioFormat format) { for (int i = 0; i < formats.Length; i++) { if (format.matches(formats[i])) { return true; } } return false; }