flashairmetadatamicrophone

Best way to handle cue points in an audio file (from microphone)


I'd like to record audio from a microphone and I'd like the user to be able to add cue points during the recording so when he loads the file afterwards, he can jump easily to a specific position.

I don't really know what file format I should use and how to store the metadata (cue points)

I thought about

  1. encoding a wav/mp3 and stores metadata in a .cue file (easy to do but 2 files to store)
  2. storing XMP data in a mp3 file (seems a bit harder but standard metadata embedded in 1 file)
  3. flv/f4v with audio only and standard cue points but I'm not sure I can create them directly from the client

What do you think?


Solution

  • Did you know that the WAV file format supports embedded CUE chunks?

    The spec says:

    The <cue-ck> cue-points chunk identifies a series of positions in 
    the waveform data stream. The <cue-ck> is defined as follows:
    <cue-ck> -> cue( <dwCuePoints:DWORD> // Count of cue points
                     <cue-point>... ) // Cue-point table
    
    <cue-point> -> struct {
        DWORD dwName;
        DWORD dwPosition;
        FOURCC fccChunk;
        DWORD dwChunkStart;
        DWORD dwBlockStart;
        DWORD dwSampleOffset;
    }
    

    For a WAV file with a single data chunk (the standard), fccChunk should be "data", chunkStart and blockStart are 0, and SampleOffset is the sample you want to mark.

    This might be the most portable way to record your cues.