I expect that I need bitwise comparisons, but I don't understand how this is done in Objective-C syntax. The following is the definition of MPMediaType.
What I need to do is to ensure that MPMediaItem is not video at all, because AVAssetReader is choking on video files, despite filtering in MPMediaTypeAnyAudio with my media query.
How can I guarantee that MPMediaItem is one of only audio types?
enum { // audio MPMediaTypeMusic = 1 << 0, MPMediaTypePodcast = 1 << 1, MPMediaTypeAudioBook = 1 << 2, MPMediaTypeAudioITunesU = 1 << 3, // available in iOS 5.0 MPMediaTypeAnyAudio = 0x00ff, // video (available in iOS 5.0) MPMediaTypeMovie = 1 << 8, MPMediaTypeTVShow = 1 << 9, MPMediaTypeVideoPodcast = 1 << 10, MPMediaTypeMusicVideo = 1 << 11, MPMediaTypeVideoITunesU = 1 << 12, MPMediaTypeAnyVideo = 0xff00, MPMediaTypeAny = ~0 }; typedef NSInteger MPMediaType;
source share