annotate libao2/afmt.c @ 3353:7894c75f66ce

similar to 1.15
author jaf
date Thu, 06 Dec 2001 19:14:05 +0000
parents 2c3ab498ac90
children 16e33d66b813
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2812
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
1 #include <stdio.h>
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
2 #include <stdlib.h>
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
3
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
4 #include "../config.h"
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
5 #include "afmt.h"
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
6
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
7 char *audio_out_format_name(int format)
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
8 {
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
9 switch (format)
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
10 {
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
11 case AFMT_MU_LAW:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
12 return("Mu-Law");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
13 case AFMT_A_LAW:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
14 return("A-Law");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
15 case AFMT_IMA_ADPCM:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
16 return("Ima-ADPCM");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
17 case AFMT_S8:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
18 return("Signed 8-bit");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
19 case AFMT_U8:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
20 return("Unsigned 8-bit");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
21 case AFMT_U16_LE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
22 return("Unsigned 16-bit (Little-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
23 case AFMT_U16_BE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
24 return("Unsigned 16-bit (Big-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
25 case AFMT_S16_LE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
26 return("Signed 16-bit (Little-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
27 case AFMT_S16_BE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
28 return("Signed 16-bit (Big-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
29 case AFMT_MPEG:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
30 return("MPEG (2) audio");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
31 case AFMT_AC3:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
32 return("AC3");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
33 /*
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
34 the following two formats are not available with old linux kernel
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
35 headers (e.g. in 2.2.16)
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
36 */
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
37 #ifdef AFMT_S32_LE
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
38 case AFMT_S32_LE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
39 return("Signed 32-bit (Little-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
40 #endif
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
41 #ifdef AFMT_S32_BE
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
42 case AFMT_S32_BE:
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
43 return("Signed 32-bit (Big-Endian)");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
44 #endif
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
45 }
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
46 return("Unknown");
2c3ab498ac90 audio_out_format_name moved from audio_out.c to afmt.c
alex
parents:
diff changeset
47 }