Correctly returning the sample rate
This commit is contained in:
parent
768e9b7bbb
commit
b475b6db45
@ -11,8 +11,7 @@ namespace tc::audio::pa {
|
||||
class PortAudioPlayback : public AudioDevicePlayback {
|
||||
public:
|
||||
static constexpr auto kChannelCount{2};
|
||||
static constexpr auto kSampleRate{44100};
|
||||
static constexpr auto kTimeSpan{0.01};
|
||||
static constexpr auto kSampleRate{48000};
|
||||
|
||||
explicit PortAudioPlayback(PaDeviceIndex index, const PaDeviceInfo* info);
|
||||
virtual ~PortAudioPlayback();
|
||||
@ -35,7 +34,7 @@ namespace tc::audio::pa {
|
||||
class PortAudioRecord : public AudioDeviceRecord {
|
||||
public:
|
||||
static constexpr auto kChannelCount{2};
|
||||
static constexpr auto kSampleRate{44100};
|
||||
static constexpr auto kSampleRate{48000};
|
||||
|
||||
explicit PortAudioRecord(PaDeviceIndex index, const PaDeviceInfo* info);
|
||||
virtual ~PortAudioRecord();
|
||||
|
@ -63,7 +63,7 @@ bool PortAudioPlayback::impl_start(std::string &error) {
|
||||
nullptr,
|
||||
¶meters,
|
||||
(double) kSampleRate,
|
||||
(unsigned long) (kSampleRate * kTimeSpan),
|
||||
paFramesPerBufferUnspecified,
|
||||
paClipOff,
|
||||
proxied_write_callback,
|
||||
this
|
||||
@ -100,7 +100,7 @@ void PortAudioPlayback::impl_stop() {
|
||||
}
|
||||
|
||||
size_t PortAudioPlayback::sample_rate() const {
|
||||
return (size_t) this->info->defaultSampleRate;
|
||||
return (size_t) kSampleRate;
|
||||
}
|
||||
|
||||
void PortAudioPlayback::write_callback(void *output, unsigned long frameCount,
|
||||
|
@ -98,7 +98,7 @@ void PortAudioRecord::impl_stop() {
|
||||
}
|
||||
|
||||
size_t PortAudioRecord::sample_rate() const {
|
||||
return (size_t) this->info->defaultSampleRate;
|
||||
return kSampleRate;
|
||||
}
|
||||
|
||||
void PortAudioRecord::read_callback(const void *input, unsigned long frameCount,
|
||||
|
Loading…
Reference in New Issue
Block a user