示例#1
0
static int
aif2format(aifheader_t * aif)
{
    int             sampwidth = (aif->bitdepth + 7) / 8;
    if (chktype("") || chktype("NONE"))
        switch (sampwidth) {
        case 1:
            return AIF_FMT_8;
        case 2:
            return AIF_FMT_16;
#ifdef	WAV_FMT_24
        case 3:
            return WAV_FMT_24;
#endif
#ifdef	AIF_FMT_32
        case 4:
            return AIF_FMT_32;
#endif
        default:
            return -1;
    } else if (chktype("sowt")) {
        if (sampwidth == 1)
            return AIF_FMT_8;
        return wav2format(&(wavheader_t) {
                          .format = 1,.bitdepth = aif->bitdepth}
        );
    } else if (chktype("alaw") || chktype("ALAW"))
示例#2
0
文件: type.c 项目: AlessandroOneto/M2
node chktypelist(node e,scope v) {
     node l = NULL, m;
     if (ispos(e)) e = e->body.position.contents;
     while (e != NULL) {
	  push(l,chktype(CAR(e),v));
	  e = CDR(e);
	  }
     m = reverse(l);
     return m;
     }