title: ALSA audio and YouTube
body: <p>I want to play youtube videos and programmatically direct firefox's audio out to a particular sound card.</p>
  
  <p>I think I would do something like <code>firefox | aplay -D hw:x,y.</code>
  Yields:</p>
  
  <blockquote>
    <p>Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    aplay: set_params:1059: Sample format non available
    Available formats:
    - S16_LE</p>
  </blockquote>
  
  <p>Trying <code>firefox | aplay -D hw:1,0 -f S16_LE -c 2</code></p>
  
  <blockquote>
    <p>Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
    Warning: rate is not accurate (requested = 8000Hz, got = 44100Hz)
             please, try the plug plugin </p>
  </blockquote>
  
  <p>Finally, <code>firefox | aplay -D plughw:1,0 -f S16_LE -c 2</code></p>
  
  <blockquote>
    <p>Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo</p>
  </blockquote>
  
  <p>The command-line suggests that it worked, but audio came out of hw:0,0 (the default). </p>
  
  <p>Do I need to make my own plugin?
  Or do I need to force alsa to take 44100Hz?</p>
  
  <p>Also, I refuse to use pulse since the memory leak bug makes it crash often.</p>