mp3dec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. .TH MP3DEC 1
  2. .SH NAME
  3. mp3dec \- play audio MPEG 1.0/2.0 file (layers 1, 2 and 3)
  4. .SH SYNOPSIS
  5. .B mp3dec
  6. [
  7. .B \-0124cmqsvy
  8. ] [
  9. .BI \-a " dev"
  10. ] [
  11. .BI \-b " size"
  12. ] [
  13. .BI \-d " n"
  14. ] [
  15. .BI \-f " factor"
  16. ] [
  17. .BI \-g " gain"
  18. ] [
  19. .BI \-h " n"
  20. ] [
  21. .BI \-k " num"
  22. ] [
  23. .BI \-n " num"
  24. ] [
  25. .B -o
  26. .B [shl]
  27. ] [
  28. .BI \-p " proxy"
  29. ] [
  30. .BI \-r " rate"
  31. ]
  32. .IR file " ...
  33. .SH DESCRIPTION
  34. .I Mp3dec
  35. reads one or more
  36. .IR file s
  37. (which may be URLs)
  38. and, by default, plays them on the audio device.
  39. The output format is raw (headerless) linear PCM audio data,
  40. 16-bit, stereo, in host byte order.
  41. .IR File
  42. is assumed to contain a valid MPEG-1/2 audio layer-1, -2 or -3 bit stream.
  43. Any name starting with
  44. .L http://
  45. is recognized as a URL.
  46. .LP
  47. Interrupting
  48. .I mp3dec
  49. will skip to the next argument
  50. .IR file .
  51. Two interrupts within a second will terminate
  52. .IR mp3dec .
  53. .LP
  54. Options are:
  55. .TF "-f fact"
  56. .TP
  57. .B "-0 -1"
  58. Decode only channel 0 (left) or channel 1 (right),
  59. respectively. These options are available for stereo MPEG streams only.
  60. .TP
  61. .B "-2 -4"
  62. Down-sample with ratio 2:1 (22 kHz) or 4:1 (11 kHz),
  63. respectively.
  64. Saves some CPU cycles, but the 4:1 ratio, at least, sounds ugly.
  65. .TP
  66. .BI "-a " dev
  67. Specify the audio device to use. The default is
  68. .BR /dev/audio .
  69. Use this option if you have multiple audio devices and
  70. the default is not what you want.
  71. .TP
  72. .BI "-b " size
  73. Use an audio output buffer of
  74. .I size
  75. Kbytes. This is useful to work around short periods of heavy
  76. system activity, which would normally cause the audio output
  77. to be interrupted.
  78. You should specify a buffer size of at least 1024
  79. (i.e. 1 Mb, which equals about 6 seconds of audio data) or more;
  80. less than about 300 does not make much sense. The default is 0,
  81. which turns buffering off.
  82. .TP
  83. .B -c
  84. Check for filter range violations, and report them for each frame
  85. if any occur.
  86. .TP
  87. .BI "-d " n
  88. Only play every
  89. .IR n 'th
  90. frame. This will cause the MPEG stream to be played
  91. .I n
  92. times faster, which can be used for special
  93. effects. Can also be combined with the
  94. .B -h
  95. option to play 3 out of 4 frames etc.
  96. Sound quality will be poor.
  97. .TP
  98. .BI "-f " factor
  99. Change scale factor (default: 32768).
  100. .TP
  101. .BI "-g " gain
  102. Set audio hardware output gain (default: don't change).
  103. .TP
  104. .BI "-h " n
  105. Play each frame
  106. .I n
  107. times. This will cause the MPEG stream
  108. to be played at
  109. .RI 1/ n 'th
  110. speed
  111. .RI ( n
  112. times slower), which can be
  113. used for special effects. Can also be combined with the
  114. .B -d
  115. option to double every third frame or things like that.
  116. Sound quality will be poor.
  117. .TP
  118. .BI "-k " num
  119. Skip the first
  120. .I num
  121. frames. By default the decoding starts at the first frame.
  122. .TP
  123. .B -m
  124. Mix both channels.
  125. This option is available for stereo MPEG layer-3 streams only. It takes less
  126. CPU time than full stereo decoding.
  127. .TP
  128. .BI "-n " num
  129. Decode only
  130. .I num
  131. frames. By default the complete stream is decoded.
  132. .TP
  133. .B -o
  134. Direct audio output to the speaker
  135. .RB ( s ),
  136. headphones
  137. .RB ( h ),
  138. or line-out
  139. .RB ( l ).
  140. .TP
  141. .BI "-p " proxy
  142. The specified
  143. .I proxy
  144. will be used for HTTP requests. It
  145. should be specified as a full URL (``http://host.domain:port/''),
  146. but the
  147. .L http://
  148. prefix, the port number and the trailing
  149. slash are optional (the default port is 80). Specifying
  150. .B none
  151. means not to use any proxy.
  152. In the absence of
  153. .BR -p ,
  154. .I mp3dec
  155. looks for environment variables named
  156. .BR MP3_HTTP_PROXY ,
  157. .BR http_proxy ,
  158. and
  159. .BR HTTP_PROXY ,
  160. in that order.
  161. .TP
  162. .B -q
  163. Quiet: suppress diagnostic messages.
  164. .TP
  165. .BI "-r " rate
  166. Set sample rate (default: automatic). You may want to
  167. change this if you need a constant bitrate independent of the MPEG stream rate.
  168. .I Mp3dec
  169. automagically converts the rate.
  170. You should then combine this with \-\-stereo or \-\-mono.
  171. .TP
  172. .B -s
  173. Write the decoded audio samples to standard output.
  174. .TP
  175. .BI "-u " auth
  176. HTTP authentication to use when fetching files via HTTP.
  177. The format used is
  178. .IB user : password.
  179. .TP
  180. .B -v
  181. Increase the verbosity level
  182. (e.g., prints the frame numbers during decoding).
  183. .TP
  184. .B -y
  185. Try to resync and continue decoding if an error occurs in
  186. the input file. Also try to recover from certain broken
  187. headers. Useful if you have a broken MPEG file, on which
  188. .I mp3dec
  189. normally gives up saying `Illegal header'. Be careful:
  190. Broken locations in MPEG files might cause sharp, loud pops or
  191. clicks, which might damage your speakers if played too loud.
  192. .TP
  193. .B \-z
  194. Shuffle play: randomly shuffles the argument files.
  195. .TP
  196. .B -Z
  197. Fully random play.
  198. .TP
  199. .B --stereo
  200. Force stereo output.
  201. .TP
  202. .B --reopen
  203. Forces reopening the audio device after every song.
  204. .TP
  205. .B --8bit
  206. Forces 8-bit output.
  207. .SH BUGS
  208. It's another GNU behemoth, lightly tamed.
  209. .PP
  210. It's slow.
  211. .PP
  212. MPEG-2 Layers 1 and 2 are not tested and may not work.
  213. Free-format streams are not supported.
  214. No CRC error checking is performed.
  215. .SH SOURCE
  216. .B /sys/src/games/mp3dec
  217. .SH "SEE ALSO"
  218. .IR mp3enc (1),
  219. .IR juke (7),
  220. .IR playlistfs (7)
  221. .br
  222. .B http://www.sfs.nphil.uni-tuebingen.de/~hipp/mpg123.html
  223. .br
  224. .B http://ftp.tu-clausthal.de/pub/unix/audio/mpg123