Remove hardcoded 44100 samplerate
This commit is contained in:
parent
bb529c011e
commit
391d31659b
@ -139,8 +139,8 @@ namespace Recorder
|
||||
fwrite(&frame_size, 1, sizeof(uint32_t), vb_data);
|
||||
fwrite(&last_timestamp, 1, sizeof(int64_t), vb_data);
|
||||
fwrite(op.packet, 1, frame_size, vb_data);
|
||||
double s =
|
||||
(double)op.granulepos / 44100. * 1000000000.;
|
||||
double s = (double)op.granulepos /
|
||||
(double)ved->m_sample_rate * 1000000000.;
|
||||
last_timestamp = (int64_t)s;
|
||||
}
|
||||
}
|
||||
|
@ -198,6 +198,12 @@ namespace Recorder
|
||||
Log::error("WasapiRecorder", "Unsupported audio input format");
|
||||
return NULL;
|
||||
}
|
||||
if (ved.m_sample_rate > 48000)
|
||||
{
|
||||
Log::error("WasapiRecorder", "Only support maximum 48000hz sample "
|
||||
"rate audio.");
|
||||
return NULL;
|
||||
}
|
||||
HRESULT hr = g_wasapi_data.m_client->Reset();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user