Holds a list of cues
The specs for reading and writing cues from the cue and list RIFF chunks are from http://www.sonicspot.com/guide/wavefiles.html and http://www.wotsit.org/ ------------------------------ The cues are stored like this: ------------------------------ struct CuePoint { Int32 dwIdentifier; Int32 dwPosition; Int32 fccChunk; Int32 dwChunkStart; Int32 dwBlockStart; Int32 dwSampleOffset; } struct CueChunk { Int32 chunkID; Int32 chunkSize; Int32 dwCuePoints; CuePoint[] points; } ------------------------------ Labels look like this: ------------------------------ struct ListHeader { Int32 listID; /* 'list' */ Int32 chunkSize; /* includes the Type ID below */ Int32 typeID; /* 'adtl' */ } struct LabelChunk { Int32 chunkID; Int32 chunkSize; Int32 dwIdentifier; Char[] dwText; /* Encoded with extended ASCII */ } LabelChunk;
Example #1
0
 /// <summary>
 /// Adds a cue to the Wave file
 /// </summary>
 /// <param name="position">Sample position</param>
 /// <param name="label">Label text</param>
 public void AddCue(int position, string label)
 {
     if (cues == null)
     {
         cues = new CueList();
     }
     cues.Add(new Cue(position, label));
 }
 /// <summary>
 /// Adds a cue to the Wave file
 /// </summary>
 /// <param name="position">Sample position</param>
 /// <param name="label">Label text</param>
 public void AddCue(int position, string label)
 {
     if (cues == null)
     {
         cues = new CueList();
     }
     cues.Add(new Cue(position, label));
 }
Example #3
0
        internal static CueList FromChunks(WaveFileReader reader)
        {
            CueList result = null;

            byte[] array  = null;
            byte[] array2 = null;
            foreach (RiffChunk riffChunk in reader.ExtraChunks)
            {
                if (riffChunk.IdentifierAsString.ToLower() == "cue ")
                {
                    array = reader.GetChunkData(riffChunk);
                }
                else if (riffChunk.IdentifierAsString.ToLower() == "list")
                {
                    array2 = reader.GetChunkData(riffChunk);
                }
            }
            if (array != null && array2 != null)
            {
                result = new CueList(array, array2);
            }
            return(result);
        }
Example #4
0
        /// <summary>
        /// Checks if the cue and list chunks exist and if so, creates a cue list
        /// </summary>
        internal static CueList FromChunks(WaveFileReader reader)
        {
            CueList cueList = null;

            byte[] cueChunkData  = null;
            byte[] listChunkData = null;

            foreach (RiffChunk chunk in reader.ExtraChunks)
            {
                if (chunk.IdentifierAsString.ToLower() == "cue ")
                {
                    cueChunkData = reader.GetChunkData(chunk);
                }
                else if (chunk.IdentifierAsString.ToLower() == "list")
                {
                    listChunkData = reader.GetChunkData(chunk);
                }
            }
            if (cueChunkData != null && listChunkData != null)
            {
                cueList = new CueList(cueChunkData, listChunkData);
            }
            return(cueList);
        }
Example #5
0
        /// <summary>
        /// Checks if the cue and list chunks exist and if so, creates a cue list
        /// </summary>
        internal static CueList FromChunks(WaveFileReader reader)
        {
            CueList cueList = null;
            byte[] cueChunkData = null;
            byte[] listChunkData = null;

            foreach (RiffChunk chunk in reader.ExtraChunks)
            {
                if (chunk.IdentifierAsString.ToLower() == "cue ")
                {
                    cueChunkData = reader.GetChunkData(chunk);
                }
                else if (chunk.IdentifierAsString.ToLower() == "list")
                {
                    listChunkData = reader.GetChunkData(chunk);
                }
            }
            if (cueChunkData != null && listChunkData != null)
            {
                cueList = new CueList(cueChunkData, listChunkData);
            }
            return cueList;
        }