How do you display song lyrics in Karaoke style on the iPhone?

后端 未结 3 1759
深忆病人
深忆病人 2021-01-07 08:32

I am currently creating an app that plays music. I would like to add a feature that shows the music lyrics while the music plays, with the current position of the text marke

3条回答
  •  孤街浪徒
    2021-01-07 09:32

    You should be able to do this through the MusicPlayer API, specifically the MusicTrack MIDIMetaEvent assuming midi type music is acceptable.

    MIDIMetaEvent
    
    Describes a MIDI metaevent such as lyric text, time signature, and so on.
    
    typedef struct MIDIMetaEvent {
       UInt8    metaEventType;
       UInt8    unused1;
       UInt8    unused2;
       UInt8    unused3;
       UInt32   dataLength;
       UInt8    data[1];
    } MIDIMetaEvent;
    

    Alternately, you might also made some headway looking at iD3 metadata for storing lyrics and timing info.

    Either way, there will be lots of file prep in getting the lyrics and timing into the music files.

提交回复
热议问题