Difference between revisions of "Sound"

From Noah.org
Jump to navigationJump to search
(New page: Category:Engineering This turns off and on the master volume switch in Linux from the command-line. This is useful for scripting. <pre> amixer sset Master off amixer sset Master on <...)
 
Line 1: Line 1:
 
[[Category:Engineering]]
 
[[Category:Engineering]]
 +
 +
= Notes on Sound and Audio =
 +
 +
== Master volume ==
  
 
This turns off and on the master volume switch in Linux from the command-line. This is useful for scripting.
 
This turns off and on the master volume switch in Linux from the command-line. This is useful for scripting.
Line 6: Line 10:
 
amixer sset Master off
 
amixer sset Master off
 
amixer sset Master on
 
amixer sset Master on
 +
</pre>
 +
 +
== Play raw audio ==
 +
 +
This shows how to play a raw audio byte stream of 44.1 kHz, 16-bit, single channel, unsigned integer. In this example the file, entropy-source.bin, is a binary file of random bytes. Since this is noise it hardly matters how fast the data is played back.
 +
<pre>
 +
play -t raw -r 44100 -b 16 -c 1 -e unsigned-integer entropy-source.bin
 
</pre>
 
</pre>

Revision as of 21:05, 3 September 2012


Notes on Sound and Audio

Master volume

This turns off and on the master volume switch in Linux from the command-line. This is useful for scripting.

amixer sset Master off
amixer sset Master on

Play raw audio

This shows how to play a raw audio byte stream of 44.1 kHz, 16-bit, single channel, unsigned integer. In this example the file, entropy-source.bin, is a binary file of random bytes. Since this is noise it hardly matters how fast the data is played back.

play -t raw -r 44100 -b 16 -c 1 -e unsigned-integer entropy-source.bin