summaryrefslogtreecommitdiffstats
path: root/client/x11/playback.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/x11/playback.cpp')
-rw-r--r--client/x11/playback.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/client/x11/playback.cpp b/client/x11/playback.cpp
index 035d6de8..83946aac 100644
--- a/client/x11/playback.cpp
+++ b/client/x11/playback.cpp
@@ -24,12 +24,12 @@
#define REING_SIZE_MS 300
-WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size)
+WavePlayer::WavePlayer(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size)
: _pcm (NULL)
, _hw_params (NULL)
, _sw_params (NULL)
{
- if (!init(sampels_per_sec, bits_per_sample, channels, frame_size)) {
+ if (!init(samples_per_sec, bits_per_sample, channels, frame_size)) {
cleanup();
THROW("failed");
}
@@ -55,7 +55,7 @@ WavePlayer::~WavePlayer()
cleanup();
}
-bool WavePlayer::init(uint32_t sampels_per_sec,
+bool WavePlayer::init(uint32_t samples_per_sec,
uint32_t bits_per_sample,
uint32_t channels,
uint32_t frame_size)
@@ -74,7 +74,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec,
default:
return false;
}
- _sampels_per_ms = sampels_per_sec / 1000;
+ _samples_per_ms = samples_per_sec / 1000;
_frame_size = frame_size;
if ((err = snd_pcm_open(&_pcm, pcm_device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)) < 0) {
@@ -108,7 +108,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec,
return false;
}
- if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, sampels_per_sec, 0)) < 0) {
+ if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, samples_per_sec, 0)) < 0) {
LOG_ERROR("cannot set sample rate %s", snd_strerror(err));
return false;
}
@@ -124,7 +124,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec,
}
snd_pcm_uframes_t buffer_size;
- buffer_size = (sampels_per_sec * REING_SIZE_MS / 1000) / frame_size * frame_size;
+ buffer_size = (samples_per_sec * REING_SIZE_MS / 1000) / frame_size * frame_size;
if ((err = snd_pcm_hw_params_set_buffer_size_near(_pcm, _hw_params, &buffer_size)) < 0) {
LOG_ERROR("cannot set buffer size %s", snd_strerror(err));
@@ -132,7 +132,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec,
}
int direction = 1;
- snd_pcm_uframes_t period_size = (sampels_per_sec * 20 / 1000) / frame_size * frame_size;
+ snd_pcm_uframes_t period_size = (samples_per_sec * 20 / 1000) / frame_size * frame_size;
if ((err = snd_pcm_hw_params_set_period_size_near(_pcm, _hw_params, &period_size,
&direction)) < 0) {
LOG_ERROR("cannot set period size %s", snd_strerror(err));
@@ -217,5 +217,5 @@ uint32_t WavePlayer::get_delay_ms()
if (snd_pcm_delay(_pcm, &delay) < 0) {
return 0;
}
- return delay / _sampels_per_ms;
+ return delay / _samples_per_ms;
}