package av import ( "fmt" ) type SampleFormat int const ( U8 = SampleFormat(iota+1) S16 S32 FLT DBL U8P S16P S32P FLTP DBLP U32 ) func (self SampleFormat) BytesPerSample() int { switch self { case U8,U8P: return 1 case S16,S16P: return 2 case FLT,FLTP,S32,S32P,U32: return 4 case DBL,DBLP: return 8 default: return 0 } } func (self SampleFormat) String() string { switch self { case U8: return "U8" case S16: return "S16" case S32: return "S32" case FLT: return "FLT" case DBL: return "DBL" case U8P: return "U8P" case S16P: return "S16P" case FLTP: return "FLTP" case DBLP: return "DBLP" case U32: return "U32" default: return "?" } } func (self SampleFormat) IsPlanar() bool { switch self { case S16P,S32P,FLTP,DBLP: return true default: return false } } type ChannelLayout uint64 func (self ChannelLayout) String() string { return fmt.Sprintf("%dch", self.Count()) } const ( CH_FRONT_CENTER = ChannelLayout(1<