ALSA using pcm_s24le
<p>Using Linux Mint 17.1 and ALSA. I have two wav files producing identical sound: one using pcm_s16le and the other using pcm_s24le.  Each is played correctly by Totem/videos.  My code to set hardware parameters and to playback using pcm_s16le works fine.  However, when I attempt to adjust these parameters to accommodate pcm_s24le as follows:</p>

<pre><code>snd_pcm_hw_params_set_format(audioHandle, audioParams, SND_PCM_FORMAT_S24_LE);
</code></pre>

<p>[I have simply substituted 'SND_PCM_FORMAT_S24LE' for 'SND_PCM_FORMAT_S16_LE'].  The call to snd_pcm_writei is</p>

<pre><code>snd_pcm_writei(m_audioHandle, *m_pAudioFrameData, *m_pAudioFrameSize / (m_nChannels * m_bitsPerSample / 8);
</code></pre>

<p>I get mostly garbage sound (hissing, choppiness) with a hint of the correct sound.</p>

<p>Essentially my question is, how do I convert code that works for SND_PCM_FORMAT_S16_LE to work for SND_PCM_FORMAT_S24_LE?</p>