mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-16 08:56:42 -05:00
Merged pcmfinal branch.
This commit is contained in:
parent
3cc2b957fb
commit
41bb7068f2
57 changed files with 5189 additions and 3088 deletions
|
|
@ -47,7 +47,7 @@ int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, int *bufsize)
|
|||
params.mode = SND_PCM_MODE_FRAME;
|
||||
#endif
|
||||
params.format.interleave = 1;
|
||||
params.format.sfmt = SND_PCM_SFMT_S16_LE;
|
||||
params.format.sfmt = SND_PCM_FORMAT_S16_LE;
|
||||
params.format.channels = 2;
|
||||
params.format.rate = USED_RATE;
|
||||
params.start_mode = SND_PCM_START_EXPLICIT;
|
||||
|
|
@ -216,7 +216,7 @@ int main(void)
|
|||
frames_in = frames_out = 0;
|
||||
if (setparams(phandle, chandle, &latency) < 0)
|
||||
break;
|
||||
if (snd_pcm_format_set_silence(SND_PCM_SFMT_S16_LE, buffer, latency*2) < 0) {
|
||||
if (snd_pcm_format_set_silence(SND_PCM_FORMAT_S16_LE, buffer, latency*2) < 0) {
|
||||
fprintf(stderr, "silence error\n");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ int main(void)
|
|||
fprintf(stderr, "open failed: %s\n", snd_strerror(err));
|
||||
return 0;
|
||||
}
|
||||
format.sfmt = SND_PCM_SFMT_MU_LAW;
|
||||
format.sfmt = SND_PCM_FORMAT_MU_LAW;
|
||||
format.rate = 8000;
|
||||
format.channels = 1;
|
||||
if ((err = snd_pcm_playback_format(handle, &format)) < 0) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void setformat(void *phandle, void *rhandle)
|
|||
snd_pcm_format_t format;
|
||||
|
||||
bzero(&format, sizeof(format));
|
||||
format.sfmt = SND_PCM_SFMT_S16_LE;
|
||||
format.sfmt = SND_PCM_FORMAT_S16_LE;
|
||||
format.channels = 2;
|
||||
format.rate = 22050;
|
||||
if ((err = snd_pcm_playback_format(phandle, &format)) < 0) {
|
||||
|
|
|
|||
|
|
@ -52,53 +52,53 @@ void info_channel(snd_pcm_t *handle, int channel, char *id)
|
|||
printf(" overrange");
|
||||
printf("\n");
|
||||
printf(" formats :");
|
||||
if (stream_info.formats & SND_PCM_FMT_MU_LAW)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_MU_LAW)
|
||||
printf(" mu-Law");
|
||||
if (stream_info.formats & SND_PCM_FMT_A_LAW)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_A_LAW)
|
||||
printf(" a-Law");
|
||||
if (stream_info.formats & SND_PCM_FMT_IMA_ADPCM)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_IMA_ADPCM)
|
||||
printf(" IMA-ADPCM");
|
||||
if (stream_info.formats & SND_PCM_FMT_U8)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U8)
|
||||
printf(" U8");
|
||||
if (stream_info.formats & SND_PCM_FMT_S16_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S16_LE)
|
||||
printf(" S16-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_S16_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S16_BE)
|
||||
printf(" S16-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_S8)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S8)
|
||||
printf(" S8");
|
||||
if (stream_info.formats & SND_PCM_FMT_U16_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U16_LE)
|
||||
printf(" U16-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_U16_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U16_BE)
|
||||
printf(" U16-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_MPEG)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_MPEG)
|
||||
printf(" MPEG");
|
||||
if (stream_info.formats & SND_PCM_FMT_GSM)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_GSM)
|
||||
printf(" GSM");
|
||||
if (stream_info.formats & SND_PCM_FMT_S24_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S24_LE)
|
||||
printf(" S24-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_S24_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S24_BE)
|
||||
printf(" S24-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_U24_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U24_LE)
|
||||
printf(" U24-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_U24_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U24_BE)
|
||||
printf(" U24-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_S32_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S32_LE)
|
||||
printf(" S32-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_S32_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_S32_BE)
|
||||
printf(" S32-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_U32_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U32_LE)
|
||||
printf(" U32-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_U32_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_U32_BE)
|
||||
printf(" U32-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_FLOAT)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_FLOAT)
|
||||
printf(" Float");
|
||||
if (stream_info.formats & SND_PCM_FMT_FLOAT64)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_FLOAT64)
|
||||
printf(" Float64");
|
||||
if (stream_info.formats & SND_PCM_FMT_IEC958_SUBFRAME_LE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_LE)
|
||||
printf(" IEC958-LE");
|
||||
if (stream_info.formats & SND_PCM_FMT_IEC958_SUBFRAME_BE)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_BE)
|
||||
printf(" IEC958-BE");
|
||||
if (stream_info.formats & SND_PCM_FMT_SPECIAL)
|
||||
if (stream_info.formats & SND_PCM_FMTBIT_SPECIAL)
|
||||
printf(" Special");
|
||||
printf("\n");
|
||||
printf(" rates :");
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ void set_format(snd_pcm_t *phandle)
|
|||
snd_pcm_format_t format;
|
||||
|
||||
bzero(&format, sizeof(format));
|
||||
format.sfmt = SND_PCM_SFMT_S16_LE;
|
||||
format.sfmt = SND_PCM_FORMAT_S16_LE;
|
||||
format.channels = 2;
|
||||
format.rate = 44100;
|
||||
if ((err = snd_pcm_playback_format(phandle, &format)) < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue