Click here to Skip to main content
15,880,608 members
Articles / Desktop Programming / Windows Forms

BSEtunes

Rate me:
Please Sign up or sign in to vote.
4.67/5 (11 votes)
24 Apr 2010CPOL4 min read 64.4K   4.3K   58  
BSEtunes is a MySQL based, full manageable, networkable single or multiuser jukebox application
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
//  PURPOSE.
//
//  This material may not be duplicated in whole or in part, except for 
//  personal use, without the express written consent of the author. 
//
//  Email:  ianier@hotmail.com
//
//  Copyright (C) 1999-2003 Ianier Munoz. All Rights Reserved.

using System;
using System.Runtime.InteropServices;

namespace BSE.Platten.Ripper.AudioWriters
{
    [StructLayout(LayoutKind.Sequential)] 
    public class WaveFormat
    {
        #region Properties
        /// <summary>
        /// Gets or sets the FormatTag.
        /// </summary>
        public short FormatTag
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the Channels.
        /// </summary>
        public short Channels
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the SamplesPerSec.
        /// </summary>
        public int SamplesPerSec
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the AvgBytesPerSec.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
        public int AvgBytesPerSec
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the BlockAlign.
        /// </summary>
        public short BlockAlign
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the BitsPerSample.
        /// </summary>
        public short BitsPerSample
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the Size.
        /// </summary>
        public short Size
        {
            get;
            set;
        }
        #endregion

        #region MethodsPublic
        /// <summary>
        /// Initializes a new instance of the <see cref="WaveFormat"/> class.
        /// </summary>
        /// <param name="samplesPerSec">The samplesPerSec.</param>
        /// <param name="bitsPerSample">The bitsPerSample.</param>
        /// <param name="channels">The channels</param>
        public WaveFormat(int samplesPerSec, int bitsPerSample, int channels)
        {
            this.FormatTag = (short)WaveFormats.Pcm;
            this.Channels = (short)channels;
            this.SamplesPerSec = samplesPerSec;
            this.BitsPerSample = (short)bitsPerSample;
            this.BlockAlign = (short)(channels * (bitsPerSample / 8));
            this.AvgBytesPerSec = SamplesPerSec * BlockAlign;
        }
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions