<commit_before>/**
 * Copyright (c) 2014-2016 by the respective copyright holders.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.smarthome.core.audio;

/**
 * An audio format definition
 *
 * @author <NAME> - Initial API
 * @author <NAME> - Modified to match discussion in #584
 * @author <NAME> - Moved class, included constants, added toString
 */
public class AudioFormat {

    // generic mp3 format without any further constraints
    public static AudioFormat MP3 = new AudioFormat(AudioFormat.CONTAINER_NONE, AudioFormat.CODEC_MP3, null, null, null,
            null);

    // generic wav format without any further constraints
    public static AudioFormat WAV = new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, null,
            null, null, null);

    /**
     * {@link AudioCodec} encoded data without any container header or footer,
     * e.g. MP3 is a non-container format
     */
    public static final String CONTAINER_NONE = "NONE";

    /**
     * Microsofts wave container format
     *
     * @see <a href="http://bit.ly/1TUW93t">WAV Format</a>
     * @see <a href="http://bit.ly/1oRMKOt">Supported codecs</a>
     * @see <a href="http://bit.ly/1TUWSlk">RIFF container format</a>
     */
    public static final String CONTAINER_WAVE = "WAVE";

    /**
     * OGG container format
     *
     * @see <a href="http://bit.ly/1oRMWNE">OGG</a>
     */
    public static final String CONTAINER_OGG = "OGG";

    /**
     * PCM Signed
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_SIGNED = "PCM_SIGNED";

    /**
     * PCM Unsigned
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_UNSIGNED = "PCM_UNSIGNED";

    /**
     * PCM A-law
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_ALAW = "ALAW";

    /**
     * PCM u-law
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_ULAW = "ULAW";

    /**
     * MP3 Codec
     *
     * @see <a href="http://wiki.multimedia.cx/index.php?title=MP3">MP3 Codec</a>
     */
    public static final String CODEC_MP3 = "MP3";

    /**
     * Vorbis Codec
     *
     * @see <a href="http://xiph.org/vorbis/doc/">Vorbis</a>
     */
    public static final String CODEC_VORBIS = "VORBIS";

    /**
     * Codec
     */
    private final String codec;

    /**
     * Container
     */
    private final String container;

    /**
     * Big endian or little endian
     */
    private final Boolean bigEndian;

    /**
     * Bit depth
     *
     * @see <a href="http://bit.ly/1OTydad">Bit Depth</a>
     */
    private final Integer bitDepth;

    /**
     * Bit rate
     *
     * @see <a href="http://bit.ly/1OTy5rk">Bit Rate</a>
     */
    private final Integer bitRate;

    /**
     * Sample frequency
     */
    private final Long frequency;

    /**
     * Constructs an instance with the specified properties.
     *
     * Note that any properties that are null indicate that
     * the corresponding AudioFormat allows any value for
     * the property.
     *
     * Concretely this implies that if, for example, one
     * passed null for the value of frequency, this would
     * mean the created AudioFormat allowed for any valid
     * frequency.
     *
     * @param container The container for the audio
     * @param codec The audio codec
     * @param bigEndian If the audo data is big endian
     * @param bitDepth The bit depth of the audo data
     * @param bitRate The bit rate of the audio
     * @param frequency The frequency at which the audio was sampled
     */
    public AudioFormat(String container, String codec, Boolean bigEndian, Integer bitDepth, Integer bitRate,
            Long frequency) {
        super();
        this.container = container;
        this.codec = codec;
        this.bigEndian = bigEndian;
        this.bitDepth = bitDepth;
        this.bitRate = bitRate;<commit_msg>Removed unnecessary explicit call of parent constructor (parent class is the Object class). (#2330)<commit_after>/**
 * Copyright (c) 2014-2016 by the respective copyright holders.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.smarthome.core.audio;

/**
 * An audio format definition
 *
 * @author <NAME> - Initial API
 * @author <NAME> - Modified to match discussion in #584
 * @author <NAME> - Moved class, included constants, added toString
 */
public class AudioFormat {

    // generic mp3 format without any further constraints
    public static AudioFormat MP3 = new AudioFormat(AudioFormat.CONTAINER_NONE, AudioFormat.CODEC_MP3, null, null, null,
            null);

    // generic wav format without any further constraints
    public static AudioFormat WAV = new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, null,
            null, null, null);

    /**
     * {@link AudioCodec} encoded data without any container header or footer,
     * e.g. MP3 is a non-container format
     */
    public static final String CONTAINER_NONE = "NONE";

    /**
     * Microsofts wave container format
     *
     * @see <a href="http://bit.ly/1TUW93t">WAV Format</a>
     * @see <a href="http://bit.ly/1oRMKOt">Supported codecs</a>
     * @see <a href="http://bit.ly/1TUWSlk">RIFF container format</a>
     */
    public static final String CONTAINER_WAVE = "WAVE";

    /**
     * OGG container format
     *
     * @see <a href="http://bit.ly/1oRMWNE">OGG</a>
     */
    public static final String CONTAINER_OGG = "OGG";

    /**
     * PCM Signed
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_SIGNED = "PCM_SIGNED";

    /**
     * PCM Unsigned
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_UNSIGNED = "PCM_UNSIGNED";

    /**
     * PCM A-law
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_ALAW = "ALAW";

    /**
     * PCM u-law
     *
     * @see <a href="http://wiki.multimedia.cx/?title=PCM#PCM_Types">PCM Types</a>
     */
    public static final String CODEC_PCM_ULAW = "ULAW";

    /**
     * MP3 Codec
     *
     * @see <a href="http://wiki.multimedia.cx/index.php?title=MP3">MP3 Codec</a>
     */
    public static final String CODEC_MP3 = "MP3";

    /**
     * Vorbis Codec
     *
     * @see <a href="http://xiph.org/vorbis/doc/">Vorbis</a>
     */
    public static final String CODEC_VORBIS = "VORBIS";

    /**
     * Codec
     */
    private final String codec;

    /**
     * Container
     */
    private final String container;

    /**
     * Big endian or little endian
     */
    private final Boolean bigEndian;

    /**
     * Bit depth
     *
     * @see <a href="http://bit.ly/1OTydad">Bit Depth</a>
     */
    private final Integer bitDepth;

    /**
     * Bit rate
     *
     * @see <a href="http://bit.ly/1OTy5rk">Bit Rate</a>
     */
    private final Integer bitRate;

    /**
     * Sample frequency
     */
    private final Long frequency;

    /**
     * Constructs an instance with the specified properties.
     *
     * Note that any properties that are null indicate that
     * the corresponding AudioFormat allows any value for
     * the property.
     *
     * Concretely this implies that if, for example, one
     * passed null for the value of frequency, this would
     * mean the created AudioFormat allowed for any valid
     * frequency.
     *
     * @param container The container for the audio
     * @param codec The audio codec
     * @param bigEndian If the audo data is big endian
     * @param bitDepth The bit depth of the audo data
     * @param bitRate The bit rate of the audio
     * @param frequency The frequency at which the audio was sampled
     */
    public AudioFormat(String container, String codec, Boolean bigEndian, Integer bitDepth, Integer bitRate,
            Long frequency) {
        this.container = container;
        this.codec = codec;
        this.bigEndian = bigEndian;
        this.bitDepth = bitDepth;
        this.bitRate = bitRate;
{'fraction_non_alphanumeric': 0.11337176443992314, 'fraction_numerical': 0.007912286650842093, 'mean_word_length': 2.4481683554169913, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5716564', 'n_tokens_mistral': 2785, 'n_tokens_neox': 2681, 'n_words': 811}