28 |
stream = SND_PCM_STREAM_PLAYBACK; |
stream = SND_PCM_STREAM_PLAYBACK; |
29 |
} |
} |
30 |
|
|
31 |
int AlsaIO::Initialize(uint Channels, uint Samplerate, uint Fragments, uint FragmentSize) { |
int AlsaIO::Initialize(uint Channels, uint Samplerate, uint Fragments, uint FragmentSize, String Card) { |
32 |
this->uiChannels = Channels; |
this->uiChannels = Channels; |
33 |
this->uiSamplerate = Samplerate; |
this->uiSamplerate = Samplerate; |
34 |
this->uiMaxSamplesPerCycle = FragmentSize; |
this->uiMaxSamplesPerCycle = FragmentSize; |
35 |
this->bInterleaved = true; |
this->bInterleaved = true; |
36 |
|
|
37 |
if (HardwareParametersSupported(Channels, Samplerate, Fragments, FragmentSize)) { |
if (HardwareParametersSupported(Channels, Samplerate, Fragments, FragmentSize)) { |
38 |
pcm_name = "hw:0,0"; |
pcm_name = "hw:" + Card; |
39 |
} |
} |
40 |
else { |
else { |
41 |
printf("Warning: your soundcard doesn't support chosen hardware parameters; "); |
printf("Warning: your soundcard doesn't support chosen hardware parameters; "); |
42 |
printf("trying to compensate support lack with plughw..."); |
printf("trying to compensate support lack with plughw..."); |
43 |
fflush(stdout); |
fflush(stdout); |
44 |
pcm_name = "plughw:0,0"; |
pcm_name = "plughw:" + Card; |
45 |
} |
} |
46 |
|
|
47 |
int err; |
int err; |