Skip to content

Commit fdbae3a

Browse files
committed
Include channel count, sample rate and bit depth in endpoint id
1 parent 1fc7207 commit fdbae3a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: SarAsio/sarclient.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,19 @@ bool SarClient::createEndpoints()
361361

362362
for (auto& endpoint : _driverConfig.endpoints) {
363363
SarCreateEndpointRequest request = {};
364+
std::wostringstream wos;
364365

366+
wos << UTF8ToWide(endpoint.id) << L"_"
367+
<< endpoint.channelCount << L"_"
368+
<< _bufferConfig.sampleRate << L"_"
369+
<< _bufferConfig.sampleSize;
370+
std::wstring idstr = wos.str();
365371
request.type = endpoint.type == EndpointType::Playback ?
366372
SAR_ENDPOINT_TYPE_PLAYBACK : SAR_ENDPOINT_TYPE_RECORDING;
367373
request.channelCount = endpoint.channelCount;
368374
request.index = i++;
369375
wcscpy_s(request.name, UTF8ToWide(endpoint.description).c_str());
370-
wcscpy_s(request.id, UTF8ToWide(endpoint.id).c_str());
376+
wcscpy_s(request.id, idstr.c_str());
371377

372378
if (!DeviceIoControl(_device, SAR_CREATE_ENDPOINT,
373379
(LPVOID)&request, sizeof(request), nullptr, 0, &dummy, nullptr)) {

0 commit comments

Comments
 (0)