Dynamic playlist allows you to add a constraint which has a format tag with a combo allowing you to select a media type (flac/mp3/ogg....). This feature isn't present in APG - at least not in the same form - (can you use the url tag and ends with?) - but it would be good to have something in the same form as dynamic playlists.
*** Bug 485902 has been marked as a duplicate of this bug. ***