+ * @param formatMetadata
+ * The format metadata
+ * @param contentMetadata
+ * The content metadata
+ */
+ public Metadata(FormatMetadata formatMetadata, ContentMetadata contentMetadata) {
+ this.formatMetadata = formatMetadata;
+ this.contentMetadata = contentMetadata;
+ }
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the number of channels of this metadata.
+ *
+ * @return The number of channels of this metadata
+ */
+ public int channels() {
+ return formatMetadata.channels();
+ }
+
+ /**
+ * Returns a metadata with the same parameters as this metadata and the given
+ * number of channels.
+ *
+ * @param channels
+ * The new number of channels
+ * @return A new metadata with the given number of channels
+ */
+ public Metadata channels(int channels) {
+ return new Metadata(formatMetadata.channels(channels), contentMetadata);
+ }
+
+ /**
+ * Returns the sampling frequency of this metadata.
+ *
+ * @return The sampling frequency of this metadata
+ */
+ public int frequency() {
+ return formatMetadata.frequency();
+ }
+
+ /**
+ * Returns a new metadata with the same parameters as this metadata and the
+ * given frequency.
+ *
+ * @param frequency
+ * The new frequency
+ * @return A new metadata with the given frequency
+ */
+ public Metadata frequency(int frequency) {
+ return new Metadata(formatMetadata.frequency(frequency), contentMetadata);
+ }
+
+ /**
+ * Returns the encoding of this metadata
+ *
+ * @return The encoding of this metadata