public static List<SkeletonStream> getSkeletonStreams(OggPacketReader r) throws IOException {
        Map<Integer, SkeletonStream> skelIds = new HashMap<Integer, SkeletonStream>();
        List<SkeletonStream> skels = new ArrayList<SkeletonStream>();

        int streams = 0;
        OggPacket p;
        while( (p = r.getNextPacket()) != null ) {
            Integer sidI = p.getSid();
            if (p.isBeginningOfStream()) {
                streams++;

                if (SkeletonPacketFactory.isSkeletonStream(p)) {
                    SkeletonStream skel = new SkeletonStream(p);
                    skelIds.put(sidI, skel);
                    skels.add(skel);

                    if (debugging) {
                        System.out.println("Found skeleton in stream at " + streams + " with SID " + skel.getSid());
                    }
                } else {
                    if (debugging) {
                        System.out.println("Found non-skeleton stream at " + streams + " with SID " + p.getSid());
                    }
                }
            }
            if (skelIds.containsKey(p.getSid())) {
                skelIds.get(sidI).processPacket(p);
            }
        }

        return skels;
    }