csvorbis.VorbisFile.time_total C# (CSharp) Method

time_total() public method

public time_total ( int i ) : float
i int
return float
        public float time_total(int i)
        {
            if(!skable || i>=links)return(-1);
            if(i<0)
            {
                float acc=0;
                for(int j=0;j<links;j++)
                {
                    acc+=time_total(j);
                }
                return(acc);
            }
            else
            {
                return((float)(pcmlengths[i])/vi[i].rate);
            }
        }

Usage Example

        /// <summary>Supports opening an Ogg Vorbis file</summary>
        public OggFileReader(string oggFileName)
        {
            m_vorbisFile = new VorbisFile(oggFileName);
            info = m_vorbisFile.getInfo();

            // TODO: 8 is hard coded!! need to change it dynamically by reading tags
            waveFormat = new WaveFormat(info[0].rate, 8, info[0].channels);
            pcm_total = m_vorbisFile.pcm_total(-1);

            timeSpan = m_vorbisFile.time_total(-1); // Timespan in seconds
        }
All Usage Examples Of csvorbis.VorbisFile::time_total