+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the number of channels of this metadata.
+ *
+ * @return The number of channels of this metadata
+ */
+ public int channels() {
+ return 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(channels, frequency, encoding, artist.orNull(), name.orNull());
+ }
+
+ /**
+ * Returns the sampling frequency of this metadata.
+ *
+ * @return The sampling frequency of this metadata
+ */
+ public int frequency() {
+ return 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(channels, frequency, encoding, artist.orNull(), name.orNull());
+ }
+
+ /**
+ * Returns the encoding of this metadata
+ *
+ * @return The encoding of this metadata
+ */
+ public String encoding() {
+ return encoding;
+ }
+
+ /**
+ * Returns a new metadata with the same parameters as this metadata and the
+ * given encoding.
+ *
+ * @param encoding
+ * The new encoding
+ * @return A new metadata with the given encoding
+ */
+ public Metadata encoding(String encoding) {
+ return new Metadata(channels, frequency, encoding, artist.orNull(), name.orNull());
+ }
+