Lines Matching refs:hdrp
81 audio_write_filehdr(int fd, Audio_hdr *hdrp, int file_type, char *infop, in audio_write_filehdr() argument
103 err = audio_encode_au(hdrp, infop, ilen, buf, &blen); in audio_write_filehdr()
106 err = audio_encode_wav(hdrp, buf, &blen); in audio_write_filehdr()
109 err = audio_encode_aiff(hdrp, buf, &blen); in audio_write_filehdr()
318 audio_read_filehdr(int fd, Audio_hdr *hdrp, int *file_type, char *infop, in audio_read_filehdr() argument
334 if ((err = audio_decode_filehdr(fd, buf, file_type, hdrp, &isize)) != in audio_read_filehdr()
349 if (*file_type == FILE_AU && hdrp->data_size != AUDIO_UNKNOWN_SIZE) { in audio_read_filehdr()
352 dsize = isize + hdrp->data_size + sizeof (au_filehdr_t); in audio_read_filehdr()
508 decode_aiff(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize) in decode_aiff() argument
579 hdrp->sample_rate = sr; in decode_aiff()
585 hdrp->channels = channels; in decode_aiff()
592 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_8; in decode_aiff()
595 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_16; in decode_aiff()
605 hdrp->data_size = size; in decode_aiff()
636 decode_au(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize, in decode_au() argument
658 AUDIO_AU_FILE2HOST(&fhdr.au_data_size, &hdrp->data_size); in decode_au()
659 AUDIO_AU_FILE2HOST(&fhdr.au_encoding, &hdrp->encoding); in decode_au()
660 AUDIO_AU_FILE2HOST(&fhdr.au_sample_rate, &hdrp->sample_rate); in decode_au()
661 AUDIO_AU_FILE2HOST(&fhdr.au_channels, &hdrp->channels); in decode_au()
676 decode_wav(int fd, unsigned char *buf, Audio_hdr *hdrp, int *isize) in decode_wav() argument
710 AUDIO_WAV_FILE2HOST_SHORT(&fhdr.wav_fmt_channels, &hdrp->channels); in decode_wav()
711 AUDIO_WAV_FILE2HOST_INT(&fhdr.wav_fmt_sample_rate, &hdrp->sample_rate); in decode_wav()
720 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_8; in decode_wav()
723 hdrp->encoding = AUDIO_AU_ENCODING_LINEAR_16; in decode_wav()
730 hdrp->encoding = AUDIO_AU_ENCODING_ALAW; in decode_wav()
733 hdrp->encoding = AUDIO_AU_ENCODING_ULAW; in decode_wav()
739 AUDIO_WAV_FILE2HOST_INT(&fhdr.wav_data_size, &hdrp->data_size); in decode_wav()
752 Audio_hdr *hdrp, int *isize) in audio_decode_filehdr() argument
764 hdrp->endian = audio_endian(buf, file_type); in audio_decode_filehdr()
788 if ((hdrp->endian = audio_endian(buf, file_type)) == in audio_decode_filehdr()
798 if ((err = decode_au(fd, buf, hdrp, isize, read_info)) != in audio_decode_filehdr()
804 if ((err = decode_wav(fd, buf, hdrp, isize)) != AUDIO_SUCCESS) { in audio_decode_filehdr()
809 if ((err = decode_aiff(fd, buf, hdrp, isize)) != in audio_decode_filehdr()
819 switch (hdrp->encoding) { in audio_decode_filehdr()
821 hdrp->encoding = AUDIO_ENCODING_ULAW; in audio_decode_filehdr()
822 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
823 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
826 hdrp->encoding = AUDIO_ENCODING_ALAW; in audio_decode_filehdr()
827 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
828 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
832 hdrp->encoding = AUDIO_ENCODING_LINEAR8; in audio_decode_filehdr()
834 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
836 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
837 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
840 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
841 hdrp->bytes_per_unit = 2; in audio_decode_filehdr()
842 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
845 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
846 hdrp->bytes_per_unit = 3; in audio_decode_filehdr()
847 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
850 hdrp->encoding = AUDIO_ENCODING_LINEAR; in audio_decode_filehdr()
851 hdrp->bytes_per_unit = 4; in audio_decode_filehdr()
852 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
855 hdrp->encoding = AUDIO_ENCODING_FLOAT; in audio_decode_filehdr()
856 hdrp->bytes_per_unit = 4; in audio_decode_filehdr()
857 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
860 hdrp->encoding = AUDIO_ENCODING_FLOAT; in audio_decode_filehdr()
861 hdrp->bytes_per_unit = 8; in audio_decode_filehdr()
862 hdrp->samples_per_unit = 1; in audio_decode_filehdr()
865 hdrp->encoding = AUDIO_ENCODING_G721; in audio_decode_filehdr()
866 hdrp->bytes_per_unit = 1; in audio_decode_filehdr()
867 hdrp->samples_per_unit = 2; in audio_decode_filehdr()
870 hdrp->encoding = AUDIO_ENCODING_G723; in audio_decode_filehdr()
871 hdrp->bytes_per_unit = 3; in audio_decode_filehdr()
872 hdrp->samples_per_unit = 8; in audio_decode_filehdr()
875 hdrp->encoding = AUDIO_ENCODING_G723; in audio_decode_filehdr()
876 hdrp->bytes_per_unit = 5; in audio_decode_filehdr()
877 hdrp->samples_per_unit = 8; in audio_decode_filehdr()
895 audio_encode_aiff(Audio_hdr *hdrp, unsigned char *buf, unsigned int *blen) in audio_encode_aiff() argument
910 if (hdrp->encoding != AUDIO_ENCODING_LINEAR) { in audio_encode_aiff()
930 tmp_ushort = hdrp->channels; in audio_encode_aiff()
936 tmp_ushort = hdrp->bytes_per_unit * 8; in audio_encode_aiff()
939 convert_to_ieee_extended((double)hdrp->sample_rate, in audio_encode_aiff()
971 audio_encode_au(Audio_hdr *hdrp, char *infop, unsigned int ilen, in audio_encode_au() argument
998 switch (hdrp->encoding) { in audio_encode_au()
1002 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1005 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1014 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1017 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1026 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1029 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1047 if (hdrp->samples_per_unit != 1) in audio_encode_au()
1050 switch (hdrp->bytes_per_unit) { in audio_encode_au()
1062 if (hdrp->bytes_per_unit != 1) in audio_encode_au()
1064 else if (hdrp->samples_per_unit != 2) in audio_encode_au()
1070 if (hdrp->samples_per_unit != 8) in audio_encode_au()
1072 else if (hdrp->bytes_per_unit == 3) in audio_encode_au()
1074 else if (hdrp->bytes_per_unit == 5) in audio_encode_au()
1097 AUDIO_AU_HOST2FILE(&hdrp->data_size, &fhdr.au_data_size); in audio_encode_au()
1099 AUDIO_AU_HOST2FILE(&hdrp->sample_rate, &fhdr.au_sample_rate); in audio_encode_au()
1100 AUDIO_AU_HOST2FILE(&hdrp->channels, &fhdr.au_channels); in audio_encode_au()
1130 audio_encode_wav(Audio_hdr *hdrp, unsigned char *buf, unsigned int *blen) in audio_encode_wav() argument
1145 switch (hdrp->encoding) { in audio_encode_wav()
1147 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1153 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1159 if (hdrp->bytes_per_unit != 1) { in audio_encode_wav()
1165 if (hdrp->bytes_per_unit != 2) { in audio_encode_wav()
1188 bytes_per_second = hdrp->sample_rate * hdrp->channels * in audio_encode_wav()
1189 hdrp->bytes_per_unit; in audio_encode_wav()
1190 bytes_per_sample = hdrp->channels * hdrp->bytes_per_unit; in audio_encode_wav()
1191 bits_per_sample = hdrp->bytes_per_unit * 8; in audio_encode_wav()
1196 AUDIO_WAV_HOST2FILE_SHORT(&hdrp->channels, &fhdr.wav_fmt_channels); in audio_encode_wav()
1197 AUDIO_WAV_HOST2FILE_INT(&hdrp->sample_rate, &fhdr.wav_fmt_sample_rate); in audio_encode_wav()