Also set the sample rate
This commit is contained in:
parent
8f7f85de08
commit
6bcc866459
@ -236,6 +236,7 @@ static int _event_audio_play_chunk_wave(OSS * oss, FILE * fp, RIFFChunk * rc)
|
|||||||
int fd = -1;
|
int fd = -1;
|
||||||
int format;
|
int format;
|
||||||
int channels;
|
int channels;
|
||||||
|
int speed;
|
||||||
uint8_t u8;
|
uint8_t u8;
|
||||||
|
|
||||||
while(rc->ckSize > 0)
|
while(rc->ckSize > 0)
|
||||||
@ -285,11 +286,14 @@ static int _event_audio_play_chunk_wave(OSS * oss, FILE * fp, RIFFChunk * rc)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
channels = wf.wChannels;
|
channels = wf.wChannels;
|
||||||
|
speed = wf.dwSamplesPerSec;
|
||||||
if((fd = open(dev, O_WRONLY)) < 0)
|
if((fd = open(dev, O_WRONLY)) < 0)
|
||||||
return -oss->helper->error(NULL, dev, 1);
|
return -oss->helper->error(NULL, dev, 1);
|
||||||
if(ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0
|
if(ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0
|
||||||
|| ioctl(fd, SNDCTL_DSP_CHANNELS,
|
|| ioctl(fd, SNDCTL_DSP_CHANNELS,
|
||||||
&channels) < 0)
|
&channels) < 0
|
||||||
|
|| ioctl(fd, SNDCTL_DSP_SPEED,
|
||||||
|
&speed) < 0)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
return -oss->helper->error(NULL, dev, 1);
|
return -oss->helper->error(NULL, dev, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user