Lines Matching refs:hdrp
79 audio_write_filehdr(int fd, Audio_hdr *hdrp, int file_type, char *infop, in audio_write_filehdr() argument
101 err = audio_encode_au(hdrp, infop, ilen, buf, &blen); in audio_write_filehdr()
104 err = audio_encode_wav(hdrp, buf, &blen); in audio_write_filehdr()
107 err = audio_encode_aiff(hdrp, buf, &blen); in audio_write_filehdr()
316 audio_read_filehdr(int fd, Audio_hdr *hdrp, int *file_type, char *infop, in audio_read_filehdr() argument
332 if ((err = audio_decode_filehdr(fd, buf, file_type, hdrp, &isize)) != in audio_read_filehdr()
347 if (*file_type == FILE_AU && hdrp->data_size != AUDIO_UNKNOWN_SIZE) { in audio_read_filehdr()
350 dsize = isize + hdrp->data_size + sizeof (au_filehdr_t); in audio_read_filehdr()
506 decode_aiff(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize) in decode_aiff() argument
577 hdrp->sample_rate = sr; in decode_aiff()
583 hdrp->channels = channels; in decode_aiff()
590 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_8; in decode_aiff()
593 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_16; in decode_aiff()
603 hdrp->data_size = size; in decode_aiff()
634 decode_au(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize, in decode_au() argument
656 AUDIO_AU_FILE2HOST(&fhdr.au_data_size, &hdrp->data_size); in decode_au()
657 AUDIO_AU_FILE2HOST(&fhdr.au_encoding, &hdrp->encoding); in decode_au()
658 AUDIO_AU_FILE2HOST(&fhdr.au_sample_rate, &hdrp->sample_rate); in decode_au()
659 AUDIO_AU_FILE2HOST(&fhdr.au_channels, &hdrp->channels); in decode_au()
674 decode_wav(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize) in decode_wav() argument
708 AUDIO_WAV_FILE2HOST_SHORT(&fhdr.wav_fmt_channels, &hdrp->channels); in decode_wav()
709 AUDIO_WAV_FILE2HOST_INT(&fhdr.wav_fmt_sample_rate, &hdrp->sample_rate); in decode_wav()
718 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_8; in decode_wav()
721 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_16; in decode_wav()
728 hdrp->encoding = AUDIO_AU_ENCODING_ALAW; in decode_wav()
731 hdrp->encoding = AUDIO_AU_ENCODING_ULAW; in decode_wav()
737 AUDIO_WAV_FILE2HOST_INT(&fhdr.wav_data_size, &hdrp->data_size); in decode_wav()
750 Audio_hdr *hdrp, int *isize) in audio_decode_filehdr() argument
762 hdrp->endian = audio_endian(buf, file_type); in audio_decode_filehdr()
786 if ((hdrp->endian = audio_endian(buf, file_type)) == in audio_decode_filehdr()
796 if ((err = decode_au(fd, buf, hdrp, isize, read_info)) != in audio_decode_filehdr()
802 if ((err = decode_wav(fd, buf, hdrp, isize)) != AUDIO_SUCCESS) { in audio_decode_filehdr()
807 if ((err = decode_aiff(fd, buf, hdrp, isize)) != in audio_decode_filehdr()
817 switch (hdrp->encoding) { in audio_decode_filehdr()
819 hdrp->encoding = AUDIO_ENCODING_ULAW; in audio_decode_filehdr()
820 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
821 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
824 hdrp->encoding = AUDIO_ENCODING_ALAW; in audio_decode_filehdr()
825 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
826 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
830 hdrp->encoding = AUDIO_ENCODING_LINEAR8; in audio_decode_filehdr()
832 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
834 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
835 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
838 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
839 hdrp->bytes_per_unit = 2; in audio_decode_filehdr()
840 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
843 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
844 hdrp->bytes_per_unit = 3; in audio_decode_filehdr()
845 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
848 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
849 hdrp->bytes_per_unit = 4; in audio_decode_filehdr()
850 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
853 hdrp->encoding = AUDIO_ENCODING_FLOAT; in audio_decode_filehdr()
854 hdrp->bytes_per_unit = 4; in audio_decode_filehdr()
855 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
858 hdrp->encoding = AUDIO_ENCODING_FLOAT; in audio_decode_filehdr()
859 hdrp->bytes_per_unit = 8; in audio_decode_filehdr()
860 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
863 hdrp->encoding = AUDIO_ENCODING_G721; in audio_decode_filehdr()
864 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
865 hdrp->samples_per_unit = 2; in audio_decode_filehdr()
868 hdrp->encoding = AUDIO_ENCODING_G723; in audio_decode_filehdr()
869 hdrp->bytes_per_unit = 3; in audio_decode_filehdr()
870 hdrp->samples_per_unit = 8; in audio_decode_filehdr()
873 hdrp->encoding = AUDIO_ENCODING_G723; in audio_decode_filehdr()
874 hdrp->bytes_per_unit = 5; in audio_decode_filehdr()
875 hdrp->samples_per_unit = 8; in audio_decode_filehdr()
893 audio_encode_aiff(Audio_hdr *hdrp, unsigned char *buf, unsigned int *blen) in audio_encode_aiff() argument
907 if (hdrp->encoding != AUDIO_ENCODING_LINEAR) { in audio_encode_aiff()
927 tmp_ushort = hdrp->channels; in audio_encode_aiff()
933 tmp_ushort = hdrp->bytes_per_unit * 8; in audio_encode_aiff()
936 convert_to_ieee_extended((double)hdrp->sample_rate, in audio_encode_aiff()
968 audio_encode_au(Audio_hdr *hdrp, char *infop, unsigned int ilen, in audio_encode_au() argument
995 switch (hdrp->encoding) { in audio_encode_au()
999 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1002 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1011 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1014 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1023 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1026 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1044 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1047 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1059 if (hdrp->bytes_per_unit != 1) in audio_encode_au()
1061 else if (hdrp->samples_per_unit != 2) in audio_encode_au()
1067 if (hdrp->samples_per_unit != 8) in audio_encode_au()
1069 else if (hdrp->bytes_per_unit == 3) in audio_encode_au()
1071 else if (hdrp->bytes_per_unit == 5) in audio_encode_au()
1094 AUDIO_AU_HOST2FILE(&hdrp->data_size, &fhdr.au_data_size); in audio_encode_au()
1096 AUDIO_AU_HOST2FILE(&hdrp->sample_rate, &fhdr.au_sample_rate); in audio_encode_au()
1097 AUDIO_AU_HOST2FILE(&hdrp->channels, &fhdr.au_channels); in audio_encode_au()
1127 audio_encode_wav(Audio_hdr *hdrp, unsigned char *buf, unsigned int *blen) in audio_encode_wav() argument
1142 switch (hdrp->encoding) { in audio_encode_wav()
1144 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1150 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1156 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1162 if (hdrp->bytes_per_unit != 2) { in audio_encode_wav()
1185 bytes_per_second = hdrp->sample_rate * hdrp->channels * in audio_encode_wav()
1186 hdrp->bytes_per_unit; in audio_encode_wav()
1187 bytes_per_sample = hdrp->channels * hdrp->bytes_per_unit; in audio_encode_wav()
1188 bits_per_sample = hdrp->bytes_per_unit * 8; in audio_encode_wav()
1193 AUDIO_WAV_HOST2FILE_SHORT(&hdrp->channels, &fhdr.wav_fmt_channels); in audio_encode_wav()
1194 AUDIO_WAV_HOST2FILE_INT(&hdrp->sample_rate, &fhdr.wav_fmt_sample_rate); in audio_encode_wav()