1

I want MetaEvent information from the music track. How do I get it? I am interested in the trackname and Instrument name of the track.

I see MusicTrack has newMetaEvent method but not a way to get it. This ofcourse is in Core Audio & OS X.

Thank You

4

1 回答 1

0

您使用MusicEventIterator遍历轨道事件,获取 eventInfo 并测试您正在寻找的 eventType。下面的文档中的一些参考。如何使用 a 的示例代码在MusicEventIterator这里


OSStatus MusicEventIteratorGetEventInfo (
   MusicEventIterator  inIterator,
   MusicTimeStamp      *outTimeStamp,
   MusicEventType      *outEventType,
   const void          **outEventData,
   UInt32              *outEventDataSize
); 

音乐事件类型

MIDI 和其他音乐事件类型,由音乐事件迭代器函数使用。

enum {
   kMusicEventType_NULL = 0,
   kMusicEventType_ExtendedNote,
   kMusicEventType_ExtendedTempo,
   kMusicEventType_User,
   kMusicEventType_Meta,
   kMusicEventType_MIDINoteMessage,
   kMusicEventType_MIDIChannelMessage,
   kMusicEventType_MIDIRawData,
   kMusicEventType_Parameter,
   kMusicEventType_AUPreset,
};
typedef UInt32 MusicEventType;
于 2013-06-30T20:36:09.043 回答