mp3enc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. .TH MP3ENC 1
  2. .SH NAME
  3. mp3enc \- create mp3 audio files
  4. .SH SYNOPSIS
  5. .in +0.5i
  6. .ti -0.5i
  7. .B games/mp3enc
  8. [
  9. .B -hprv
  10. ] [
  11. .B -b
  12. .I bitrate
  13. ] [
  14. .B -B
  15. .I bitrate
  16. ] [
  17. .B -m
  18. .I mode
  19. ] [
  20. .B -q
  21. q ] [
  22. .B -s
  23. .I sfreq
  24. ] [
  25. .B -V
  26. .I q
  27. ] [
  28. .I "long or silly options"
  29. ]
  30. .in -0.5i
  31. .SH DESCRIPTION
  32. .I Mp3enc
  33. compresses audio on standard input,
  34. normally PCM-encoded,
  35. and produces MP3-encoded audio on standard output.
  36. By default, the MP3 file will use `constant bit-rate' (CBR)
  37. encoding, but that can be changed via
  38. .B --abr
  39. (average bitrate desired, ABR)
  40. or
  41. .BR -v
  42. (variable bitrate, VBR).
  43. .SS Options
  44. .TF "\fB-b \fP"
  45. .TP
  46. .B -b
  47. set minimum allowed
  48. .I bitrate
  49. in Kb/s for VBR, default 32Kb/s.
  50. For CBR,
  51. set the exact bitrate in Kb/s, which defaults to 128Kb/s.
  52. .TP
  53. .B -B
  54. set maximum allowed
  55. .I bitrate
  56. in Kb/s for VBR, default 256Kb/s.
  57. .TP
  58. .BI -h
  59. same as
  60. .LR "-q 2" .
  61. .TP
  62. .B -m
  63. .I mode
  64. may be
  65. (s)tereo,
  66. (j)oint,
  67. (f)orce
  68. or
  69. (m)ono
  70. (default j).
  71. .B force
  72. forces mid/side stereo on all frames.
  73. .TP
  74. .B -p
  75. add CRC error protection (adds an additional 16 bits per frame to the stream).
  76. This seems to break playback.
  77. .TP
  78. .B -q
  79. sets output quality to
  80. .I q
  81. (see
  82. .BR -V ).
  83. .TP
  84. .B -r
  85. input is raw pcm
  86. .TP
  87. .B -s
  88. set sampling frequency of input file (in KHz) to
  89. .IR sfreq ,
  90. default is 44.1.
  91. .TP
  92. .B -v
  93. use variable bitrate (VBR) encoding
  94. .TP
  95. .B -V
  96. set quality setting for VBR to
  97. .IR q .
  98. Default
  99. .I q
  100. is 4;
  101. 0 produces highest-quality and largest files, and
  102. 9 produces lowest-quality and smallest files.
  103. .SS Long options
  104. .TF "\fB--resample sfreq \fP"
  105. .TP
  106. .BI --abr " bitrate"
  107. sets average
  108. .I bitrate
  109. desired in Kb/s, instead of setting quality,
  110. and generates ABR encoding.
  111. .TP
  112. .BI --resample " sfreq"
  113. set sampling frequency of output file (in KHz) to
  114. .IR sfreq ,
  115. default is input sfreq.
  116. .TP
  117. .BI --mp3input
  118. .I input
  119. is an MP3 file
  120. .
  121. .SS Silly options
  122. .TF --nohist
  123. .TP
  124. .BI -f
  125. same as
  126. .LR "-q 7" .
  127. Such a deal.
  128. .TP
  129. .BI -o
  130. mark as non-original (i.e. do not set the original bit)
  131. .TP
  132. .BI -c
  133. mark as copyright
  134. .TP
  135. .BI -k
  136. disable sfb=21 cutoff
  137. .TP
  138. .BI -e " emp"
  139. de-emphasis n/5/c
  140. (default n)
  141. .TP
  142. .BI -d
  143. allow channels to have different blocktypes
  144. .TP
  145. .BI -t
  146. disable Xing VBR informational tag
  147. .TP
  148. .BI -a
  149. autoconvert from stereo to mono file for mono encoding
  150. .TP
  151. .BI -x
  152. force byte-swapping of input (see
  153. .IR dd (1)
  154. instead)
  155. .TP
  156. .BI -S
  157. don't print progress report, VBR histograms
  158. .TP
  159. .BI --athonly
  160. only use the ATH for masking
  161. .TP
  162. .BI --nohist
  163. disable VBR histogram display
  164. .TP
  165. .BI --voice
  166. experimental voice mode
  167. .
  168. .SH EXAMPLES
  169. Encode a
  170. .L .wav
  171. file as highest-quality MP3.
  172. .IP
  173. .EX
  174. games/mp3enc -q 0 -b 320
  175. .EE
  176. .LP
  177. Create a fixed 128Kb/s MP3 file from a
  178. .L .wav
  179. file.
  180. .IP
  181. .EX
  182. games/mp3enc -h <foo.wav >foo.mp3
  183. .EE
  184. .LP
  185. Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz
  186. (you may not need
  187. .IR dd ):
  188. .IP
  189. .EX
  190. dd -conv swab | games/mp3enc -a -r -m m --resample 16 -b 24
  191. .EE
  192. .SH SOURCE
  193. .B /sys/src/games/mp3enc
  194. .SH SEE ALSO
  195. .IR dd (1),
  196. .IR mp3dec (1),
  197. .IR audio (3),
  198. .IR cdfs (4),
  199. .IR audio (7),
  200. .IR juke (7),
  201. .IR playlistfs (7)
  202. .br
  203. .B http://www.sulaco.org/mp3
  204. .SH BUGS
  205. Quality is much better than encoders based on the ISO routines,
  206. but still not as good as the FhG encoder.
  207. .PP
  208. It's a GNU behemoth, lightly rehabilitated.
  209. There are zillions of undocumented options.