manual_soundFiles.cpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. /* manual_soundFiles.cpp
  2. *
  3. * Copyright (C) 1992-2005,2007,2008,2010,2011,2014-2017 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "ManPagesM.h"
  19. void manual_soundFiles_init (ManPages me);
  20. void manual_soundFiles_init (ManPages me) {
  21. MAN_BEGIN (U"Sound files", U"ppgb", 20070602)
  22. INTRO (U"This tutorial describes the sound files that you can read "
  23. "and write with Praat. It assumes you are familiar with the @Intro.")
  24. NORMAL (U"You can read this tutorial sequentially with the help of the \"< 1\" and \"1 >\" buttons.")
  25. LIST_ITEM (U"1. @@Sound files 1. General structure|General structure@")
  26. LIST_ITEM1 (U"1.1. @@Sound files 1.1. Sampling|Sampling@ (sampling frequency)")
  27. LIST_ITEM1 (U"1.2. @@Sound files 1.2. Quantization|Quantization@ (linear, endian, μ-law, A-law)")
  28. LIST_ITEM1 (U"1.3. @@Sound files 1.3. Channels|Channels@ (mono, stereo)")
  29. LIST_ITEM1 (U"1.4. @@Sound files 1.4. The header|The header@")
  30. LIST_ITEM1 (U"1.5. @@Sound files 1.5. Size|Size@")
  31. LIST_ITEM1 (U"1.6. @@Sound files 1.6. Compression|Compression@")
  32. LIST_ITEM (U"2. @@Sound files 2. File types|File types@")
  33. LIST_ITEM1 (U"2.1. @@Sound files 2.1. WAV files|WAV files@")
  34. LIST_ITEM1 (U"2.2. @@Sound files 2.2. AIFF files|AIFF files@")
  35. LIST_ITEM1 (U"2.3. @@Sound files 2.3. AIFC files|AIFC files@")
  36. LIST_ITEM1 (U"2.4. @@Sound files 2.4. NeXT/Sun (.au) files|NeXT/Sun (.au) files@")
  37. LIST_ITEM1 (U"2.5. @@Sound files 2.5. NIST files|NIST files@")
  38. LIST_ITEM1 (U"2.6. @@Sound files 2.6. FLAC files|FLAC files@")
  39. LIST_ITEM1 (U"2.7. @@Sound files 2.7. MP3 files|MP3 files@")
  40. LIST_ITEM (U"3. @@Sound files 3. Files that Praat can read|Files that Praat can read@")
  41. LIST_ITEM (U"4. @@Sound files 4. Files that Praat can write|Files that Praat can write@")
  42. MAN_END
  43. MAN_BEGIN (U"Sound files 1. General structure", U"ppgb", 20000123)
  44. INTRO (U"This is chapter 1 of the @@Sound files@ tutorial. "
  45. "It describes the general structure of the headers and data parts of sound files.")
  46. LIST_ITEM (U"1.1. @@Sound files 1.1. Sampling|Sampling@ (sampling frequency)")
  47. LIST_ITEM (U"1.2. @@Sound files 1.2. Quantization|Quantization@ (linear, μ-law, A-law)")
  48. LIST_ITEM (U"1.3. @@Sound files 1.3. Channels|Channels@ (mono, stereo)")
  49. LIST_ITEM (U"1.4. @@Sound files 1.4. The header|The header@")
  50. LIST_ITEM (U"1.5. @@Sound files 1.5. Size|Size@")
  51. LIST_ITEM (U"1.6. @@Sound files 1.6. Compression|Compression@")
  52. MAN_END
  53. MAN_BEGIN (U"Sound files 1.1. Sampling", U"ppgb", 20040330)
  54. NORMAL (U"When a sound signal from a microphone or on a tape needs to be read into a computer, "
  55. "it is %digitized, which means that it is %sampled and %quantized.")
  56. NORMAL (U"Sampling is the discretization of the time domain of the signal: "
  57. "each second of the signal is divided up into 11025, 22050, or 44100 "
  58. "slices (or any other suitable number), and a %%sample value% is associated with "
  59. "each slice. For instance, a continuous 377-Hz sine wave is expressed by")
  60. FORMULA (U"%x(%t) = sin (2%π 377 %t)")
  61. NORMAL (U"If the %%sampling frequency% (or %%sample rate%) is 44100 Hz, this sine wave will be sampled at "
  62. "points spaced Δ%t = 1/44100 second apart, and the sample values will be")
  63. FORMULA (U"%x__%i_ = sin (2%π 377 (%t__0_ + %i Δ%t))")
  64. NORMAL (U"where %t__0_ is the time after which sampling begins. "
  65. "Δ%t is called the %%sample period%.")
  66. NORMAL (U"Quantization is handled in the next section (@@Sound files 1.2. Quantization|§1.2@).")
  67. MAN_END
  68. MAN_BEGIN (U"Sound files 1.2. Quantization", U"ppgb", 20000126)
  69. NORMAL (U"Apart from sampling (@@Sound files 1.1. Sampling|§1.1@), "
  70. "digitization also involves quantization, which is the conversion of a sample value "
  71. "into a number that fits into 8 or 16 bits.")
  72. MAN_END
  73. MAN_BEGIN (U"Sound files 1.3. Channels", U"ppgb", 20000126)
  74. NORMAL (U"For most file types, Praat supports sounds with one channel (mono) and two channels (stereo).")
  75. MAN_END
  76. MAN_BEGIN (U"Sound files 1.4. The header", U"ppgb", 20040223)
  77. NORMAL (U"The bulk of most sound files is formed by the samples. "
  78. "The sample part is usually preceded by a header, which contains "
  79. "information about:")
  80. LIST_ITEM (U"1. The type of file (WAV, AIFF, AIFC, NeXT/Sun, NIST, Kay, FLAC...).")
  81. LIST_ITEM (U"2. The sampling frequency (@@Sound files 1.1. Sampling|§1.1@).")
  82. LIST_ITEM (U"3. The encoding (linear, 8 or 16 bit, byte order, μ-law, A-law, see @@Sound files 1.2. Quantization|§1.2@).")
  83. LIST_ITEM (U"4. The number of channels (mono, stereo, see @@Sound files 1.3. Channels|§1.3@).")
  84. LIST_ITEM (U"5. The duration (usually the number of samples).")
  85. MAN_END
  86. MAN_BEGIN (U"Sound files 1.5. Size", U"ppgb", 20000126)
  87. NORMAL (U"The size of a sound file is equal to the size of the header "
  88. "plus the product of the number of samples, the quantization size, "
  89. "and the number of channels.")
  90. NORMAL (U"For instance, a stereo sound with a duration of 3 seconds, sampled at 44100 Hz, "
  91. "would, when written into a 16-bit NeXT/Sun file, take up a disk space of")
  92. FORMULA (U"28 + 2 * 3.0 * 44100 * 2 = 529228 bytes")
  93. NORMAL (U"whereas the same sound, when averaged to mono, downsampled to 8000 Hz, "
  94. "and written into a μ-law NeXT/Sun file, take up only a disk space of")
  95. FORMULA (U"28 + 1 * 3.0 * 8000 * 1 = 24028 bytes")
  96. NORMAL (U"The first example is typical of CD quality, the second of telephone speech.")
  97. MAN_END
  98. MAN_BEGIN (U"Sound files 1.6. Compression", U"ppgb", 20040602)
  99. NORMAL (U"Praat used to be able to read some compressed sound file formats (shortened NIST, Polyphone), "
  100. "but because of licensing problems (Praat went open source, Shorten did not), "
  101. "you now need to use other (freely available) programs to do the conversion before reading them into Praat. "
  102. "Praat can decode (but not create) MP3 files. "
  103. "Praat fully supports FLAC compressed files.")
  104. MAN_END
  105. MAN_BEGIN (U"Sound files 2. File types", U"ppgb", 20070602)
  106. LIST_ITEM (U"2.1. @@Sound files 2.1. WAV files|WAV files@")
  107. LIST_ITEM (U"2.2. @@Sound files 2.2. AIFF files|AIFF files@")
  108. LIST_ITEM (U"2.3. @@Sound files 2.3. AIFC files|AIFC files@")
  109. LIST_ITEM (U"2.4. @@Sound files 2.4. NeXT/Sun (.au) files|NeXT/Sun (.au) files@")
  110. LIST_ITEM (U"2.5. @@Sound files 2.5. NIST files|NIST files@")
  111. LIST_ITEM (U"2.6. @@Sound files 2.6. FLAC files|FLAC files@")
  112. LIST_ITEM (U"2.7. @@Sound files 2.7. MP3 files|MP3 files@")
  113. MAN_END
  114. MAN_BEGIN (U"Sound files 2.1. WAV files", U"ppgb", 20040223)
  115. NORMAL (U"The audio file type most commonly used on Windows computers, also very common on the Internet.")
  116. MAN_END
  117. MAN_BEGIN (U"Sound files 2.2. AIFF files", U"ppgb", 20040223)
  118. NORMAL (U"AIFF stands for: Audio Interchange File Format.")
  119. NORMAL (U"This standard format for sound files was defined by Apple. "
  120. "It is also the format of the sound files on the Iris Indigo, "
  121. "where each sample is quantized into 16 bits.")
  122. MAN_END
  123. MAN_BEGIN (U"Sound files 2.3. AIFC files", U"ppgb", 20040223)
  124. NORMAL (U"AIFC is short for AIFF(C) or AIFF-C, i.e. the Audio Interchange File Format "
  125. "(@@Sound files 2.2. AIFF files|§2.2@) with optional compression.")
  126. NORMAL (U"Praat reads and write uncompressed AIFC files, but does not support compressed AIFC files.")
  127. MAN_END
  128. MAN_BEGIN (U"Sound files 2.4. NeXT/Sun (.au) files", U"ppgb", 20110131)
  129. NORMAL (U"This is the format of the sound files on the Sun.")
  130. ENTRY (U"Reading")
  131. NORMAL (U"To read a #Sound from a Sun audio file on disk, use @@Read from file...@."
  132. "Praat then asks you for a file name. "
  133. "After you click OK, Praat determines the encoding of the file. "
  134. "If the encoding is 16-bit linear, the 16-bit sample values are divided by 32768 so that the amplitude "
  135. "of the resulting Sound is between -1.0 and +1.0. "
  136. "If the encoding is 8-bit %μ-law, the 16-bit sample value is determined by table look-up first.")
  137. NORMAL (U"The resulting Sound will appear in the list of objects; "
  138. "its name will be equal to the file name, without extension.")
  139. ENTRY (U"Saving")
  140. NORMAL (U"Use @@Save as NeXT/Sun file...@. The samples of the Sound are multiplied by 32768 "
  141. "and quantized between -32768 and 32767; "
  142. "the result is written to the file in 16-bit mono Sun audio format.")
  143. NORMAL (U"To avoid clipping, keep the absolute amplitude below 1.000. "
  144. "If the maximum sound pressure level is 91 dB (top = 32767), "
  145. "the quantization threshold is (top = 1/2) -5 dB.")
  146. MAN_END
  147. MAN_BEGIN (U"Sound files 2.5. NIST files", U"ppgb", 20040223)
  148. NORMAL (U"An audio file type used by speech researchers. Used, for instance, in the TIMIT database. "
  149. "Praat reads several kinds of NIST files: big-endian, little-endian, μ-law, A-law, Polyphone. "
  150. "NIST files compressed with #shorten are no longer supported "
  151. "(see @@Sound files 1.6. Compression|§1.6@)")
  152. MAN_END
  153. MAN_BEGIN (U"Sound files 2.6. FLAC files", U"Erez Volk", 20070514)
  154. NORMAL (U"A lossless compressed audio format (see ##http://flac.sourceforge.net##). "
  155. "Praat reads FLAC files in all bitrate/frequency settings "
  156. "(see also @@Sound files 1.6. Compression|§1.6@)")
  157. MAN_END
  158. MAN_BEGIN (U"Sound files 3. Files that Praat can read", U"ppgb", 20070602)
  159. INTRO (U"Praat can read five types of standard sound files in several formats, "
  160. "and a number of proprietary types of sound files as well.")
  161. ENTRY (U"Standard sound files")
  162. NORMAL (U"The @@Open menu@ contains two commands for opening sound files:")
  163. LIST_ITEM (U"• With @@Read from file...@, you read the entire file into memory. "
  164. "A @Sound object will appear in the list. "
  165. "This is appropriate if your sound is not too long to fit into memory. "
  166. "The advantage of having a @Sound object is that you can perform analysis "
  167. "on it directly.")
  168. LIST_ITEM (U"• With @@Open long sound file...@, you open a sound file that is too long "
  169. "to read into memory completely. A @LongSound object will appear in the list. "
  170. "You will typically choose #View to view the contents of this sound and analyse it. "
  171. "Praat will only read so much of the file into memory as is needed to play or display "
  172. "parts of it.")
  173. NORMAL (U"Both commands understand the following five standard audio file formats:")
  174. LIST_ITEM (U"• WAV:")
  175. LIST_ITEM1 (U"• linear 16-bit little-endian")
  176. LIST_ITEM1 (U"• 8-bit μ-law")
  177. LIST_ITEM1 (U"• 8-bit A-law")
  178. LIST_ITEM1 (U"• linear 8-bit unsigned")
  179. LIST_ITEM (U"• AIFF or AIFC:")
  180. LIST_ITEM1 (U"• linear 16-bit big-endian")
  181. LIST_ITEM1 (U"• linear 8-bit signed")
  182. LIST_ITEM (U"• NeXT/Sun (.au):")
  183. LIST_ITEM1 (U"• linear 16-bit big-endian")
  184. LIST_ITEM1 (U"• 8-bit μ-law")
  185. LIST_ITEM1 (U"• 8-bit A-law")
  186. LIST_ITEM1 (U"• linear 8-bit signed")
  187. LIST_ITEM (U"• NIST:")
  188. LIST_ITEM1 (U"• linear 16-bit little-endian")
  189. LIST_ITEM1 (U"• linear 16-bit big-endian")
  190. LIST_ITEM1 (U"• 8-bit μ-law")
  191. LIST_ITEM1 (U"• 8-bit A-law")
  192. LIST_ITEM1 (U"• linear 8-bit signed")
  193. LIST_ITEM (U"• FLAC:")
  194. LIST_ITEM1 (U"• 8-bit, 16-bit, 24-bit or 32-bit")
  195. LIST_ITEM1 (U"• all sampling frequencies")
  196. LIST_ITEM (U"• MP3:")
  197. LIST_ITEM1 (U"• all constant or variable bitrates")
  198. MAN_END
  199. MAN_BEGIN (U"Sound files 4. Files that Praat can write", U"ppgb", 20110129)
  200. INTRO (U"Praat can write five types of standard sound files in an appropriate linear 16-bit formats, "
  201. "and a number of proprietary types of sound files as well:")
  202. LIST_ITEM (U"• @@Save as WAV file...@ (16-bit little-endian)")
  203. LIST_ITEM (U"• @@Save as AIFF file...@ (16-bit big-endian)")
  204. LIST_ITEM (U"• @@Save as AIFC file...@ (16-bit big-endian)")
  205. LIST_ITEM (U"• @@Save as NeXT/Sun file...@ (16-bit big-endian)")
  206. LIST_ITEM (U"• @@Save as NIST file...@ (16-bit little-endian)")
  207. LIST_ITEM (U"• @@Save as FLAC file...@ (16-bit)")
  208. MAN_END
  209. MAN_BEGIN (U"AIFF and AIFC files", U"ppgb", 20110131)
  210. INTRO (U"Ways for storing a @Sound object on disk.")
  211. ENTRY (U"File format")
  212. ENTRY (U"Reading")
  213. NORMAL (U"@@Read from file...@ recognizes AIFF and AIFC files with 8-bit and 16-bit encoding, "
  214. "but not compressed AIFC files. It recognizes any sampling frequency. The two channels of stereo files "
  215. "are averaged. ##Read two Sounds from AIFF file...# reads both channels separately and names "
  216. "them %left and %right.")
  217. NORMAL (U"The sample values are divided by 2^^(%numberOfBitsPerSample – 1)^, "
  218. "so that the amplitude of the resulting Sound is between –1.0 and +1.0; "
  219. "the maximum sound pressure level for a sine wave is therefore: "
  220. "20 · ^^10^log (√2 / 2·10^^–5^) = 91 dB.")
  221. NORMAL (U"The resulting Sound will appear in the List of Objects; "
  222. "its name will be equal to the file name, without extension.")
  223. ENTRY (U"Saving")
  224. NORMAL (U"With @@Save as AIFF file...@.")
  225. NORMAL (U"The samples of the Sound are multiplied by 32768 "
  226. "and quantized between –32768 and 32767.")
  227. NORMAL (U"To avoid clipping, keep the absolute amplitude below 1.000. "
  228. "If the maximum sound pressure level is 91 dB (top = 32767), "
  229. "the quantization threshold is (top = 1/2) –5 dB.")
  230. MAN_END
  231. MAN_BEGIN (U"Save as WAV file...", U"ppgb", 20110129)
  232. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  233. "as a single 16-bit little-endian WAV file on disk. See the @@Sound files@ tutorial for more information.")
  234. MAN_END
  235. MAN_BEGIN (U"Save as AIFF file...", U"ppgb", 20110129)
  236. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  237. "as a single 16-bit big-endian AIFF file on disk. See the @@Sound files@ tutorial for more information.")
  238. /*ENTRY (U"AIFF file format for writing")
  239. NORMAL (U"Although")*/
  240. MAN_END
  241. MAN_BEGIN (U"Save as AIFC file...", U"ppgb", 20110129)
  242. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  243. "as a single 16-bit big-endian AIFC file on disk. See the @@Sound files@ tutorial for more information.")
  244. MAN_END
  245. MAN_BEGIN (U"Save as NeXT/Sun file...", U"ppgb", 20110129)
  246. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  247. "as a single 16-bit big-endian NeXT/Sun (.au) file on disk. See the @@Sound files@ tutorial for more information.")
  248. MAN_END
  249. MAN_BEGIN (U"Save as NIST file...", U"ppgb", 20110129)
  250. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  251. "as a single 16-bit little-endian NIST audio file on disk. See the @@Sound files@ tutorial for more information.")
  252. MAN_END
  253. MAN_BEGIN (U"Save as FLAC file...", U"ppgb", 20110129)
  254. INTRO (U"With this command, you save one or more selected @Sound and/or @LongSound objects "
  255. "as a single 16-bit FLAC audio file on disk. See the @@Sound files@ tutorial for more information.")
  256. MAN_END
  257. MAN_BEGIN (U"Sound files 2.7. MP3 files", U"Erez Volk", 20070601)
  258. NORMAL (U"A ubiquitous lossy audio compression format. "
  259. "Praat supports MP3 decoding through the MPEG Audio Decoder library "
  260. "##http://www.underbit.com/products/mad/##. "
  261. "(see also @@Sound files 1.6. Compression|§1.6@)")
  262. MAN_END
  263. MAN_BEGIN (U"NIST files", U"Erez Volk", 20110131)
  264. INTRO (U"A way for storing a @Sound object on disk.")
  265. ENTRY (U"File format")
  266. NORMAL (U"The compressed sound files of the Timit database, and the Groningen speech corpus.")
  267. ENTRY (U"Reading")
  268. NORMAL (U"With @@Read from file...@.")
  269. ENTRY (U"Saving")
  270. NORMAL (U"With ##Save as NIST audio file...#.")
  271. MAN_END
  272. MAN_BEGIN (U"FLAC files", U"Erez Volk", 20110131)
  273. INTRO (U"A way for storing a @Sound object on disk.")
  274. ENTRY (U"File format")
  275. NORMAL (U"A lossless compressed audio file format.")
  276. ENTRY (U"Reading")
  277. NORMAL (U"With @@Read from file...@.")
  278. ENTRY (U"Saving")
  279. NORMAL (U"With ##Save as FLAC audio file...#.")
  280. MAN_END
  281. MAN_BEGIN (U"How to concatenate sound files", U"ppgb", 20110131)
  282. INTRO (U"You can concatenate any combination of AIFF, AIFC, WAV, NeXT/Sun, NIST "
  283. "and FLAC audio files, and other files that you have read into memory.")
  284. NORMAL (U"For instance, if you want to concatenate a 30-minute AIFF file, "
  285. "a 4-minute Kay sound file, and a 60-minute Next/Sun file, "
  286. "by saving them into a 94-minute WAV file, "
  287. "you do the following:")
  288. LIST_ITEM (U"1. Open the AIFF file with @@Open long sound file...@ from the @@Open menu@. "
  289. "A @LongSound object will appear in the list.")
  290. LIST_ITEM (U"2. Read the Kay sound file into memory with @@Read from file...@. "
  291. "A @Sound object will appear in the list.")
  292. LIST_ITEM (U"3. Open the AIFF file with @@Open long sound file...@ from the @@Open menu@. "
  293. "A second @LongSound object will appear in the list.")
  294. LIST_ITEM (U"4. Select the three objects and choose @@Save as WAV file...@ "
  295. "from the @@Save menu@.")
  296. NORMAL (U"This only works if all the sounds have the same sampling frequency "
  297. "and the same number of channels.")
  298. ENTRY (U"Available formats")
  299. NORMAL (U"The format of the original sound files may be 16-bit linear "
  300. "(with big-endian or little-endian byte order), 8-bit linear (signed or unsigned), "
  301. "8-bit μ-law, or 8-bit A-law. The format of the resulting sound file is always "
  302. "16-bit linear, with an appropriate default byte order. The following commands "
  303. "are available in the @@Save menu@ if you select any combination of @LongSound "
  304. "and/or @Sound objects:")
  305. LIST_ITEM (U"• @@Save as WAV file...@ (little-endian)")
  306. LIST_ITEM (U"• @@Save as AIFF file...@ (big-endian)")
  307. LIST_ITEM (U"• @@Save as AIFC file...@ (big-endian)")
  308. LIST_ITEM (U"• @@Save as NeXT/Sun file...@ (big-endian)")
  309. LIST_ITEM (U"• @@Save as NIST file...@ (little-endian)")
  310. LIST_ITEM (U"• @@Save as FLAC file...@")
  311. MAN_END
  312. MAN_BEGIN (U"LongSound", U"ppgb", 20110131)
  313. INTRO (U"One of the @@types of objects@ in Praat. See the @@Sound files@ tutorial.")
  314. NORMAL (U"A LongSound object gives you the ability to view and label "
  315. "a sound file that resides on disk. You will want to use it for sounds "
  316. "that are too long to read into memory as a @Sound object (typically, a few minutes).")
  317. ENTRY (U"How to create a LongSound object")
  318. NORMAL (U"You create a LongSound object with @@Open long sound file...@ from the @@Open menu@.")
  319. ENTRY (U"What you can do with a LongSound object")
  320. NORMAL (U"You can save a LongSound object to a new sound file, "
  321. "perhaps in a different format (AIFF, AIFC, WAV, NeXT/Sun, NIST, FLAC) "
  322. "with the commands in the Save menu. You can also concatenate several "
  323. "LongSound objects in this way. See @@How to concatenate sound files@.")
  324. ENTRY (U"How to view and edit a LongSound object")
  325. NORMAL (U"You can view a LongSound object in a @LongSoundEditor by choosing @@LongSound: View@. "
  326. "This also allows you to extract parts of the LongSound as @Sound objects, "
  327. "or save these parts as a sound file. "
  328. "There are currently no ways to actually change the data in the file.")
  329. ENTRY (U"How to annotate a LongSound object")
  330. NORMAL (U"You can label and segment a LongSound object after the following steps:")
  331. LIST_ITEM (U"1. Select the LongSound object.")
  332. LIST_ITEM (U"2. Choose @@LongSound: To TextGrid...@ and specify your tiers.")
  333. LIST_ITEM (U"3. Select the resulting @TextGrid object together with the LongSound object, and click ##View & Edit#.")
  334. NORMAL (U"A @TextGridEditor will appear on the screen, with a copy of the LongSound object in it.")
  335. ENTRY (U"Limitations")
  336. NORMAL (U"The length of the sound file is limited to 2 gigabytes, which is 3 hours of CD-quality stereo, "
  337. "or 12 hours 16-bit mono sampled at 22050 Hz.")
  338. MAN_END
  339. MAN_BEGIN (U"LongSound: To TextGrid...", U"ppgb", 19980730)
  340. INTRO (U"A command to create a @TextGrid without any labels, copying the time domain from the selected @LongSound.")
  341. NORMAL (U"See @@Sound: To TextGrid...@ for the settings.")
  342. MAN_END
  343. MAN_BEGIN (U"LongSound: View", U"ppgb", 19980730)
  344. INTRO (U"A command to view the selected @LongSound object in a @LongSoundEditor.")
  345. MAN_END
  346. MAN_BEGIN (U"LongSoundEditor", U"ppgb", 20041124)
  347. INTRO (U"One of the @Editors in Praat, for viewing a @LongSound object.")
  348. NORMAL (U"This viewer allows you:")
  349. LIST_ITEM (U"• to view and hear parts of the sound as it is on disk;")
  350. LIST_ITEM (U"• to copy a selected part as a @Sound object to the list of objects, so that you "
  351. "can perform analyses on it or save it to a smaller sound file;")
  352. LIST_ITEM (U"• to copy a selected part as a @Sound object to the @Sound clipboard, "
  353. "so that you can paste it into another Sound object that you are viewing in a @SoundEditor.")
  354. NORMAL (U"To label and segment the LongSound object, use the @TextGridEditor instead (see @LongSound).")
  355. NORMAL (U"The display and playback of the samples is restricted to 60 seconds at a time, for reasons of speed "
  356. "(although you can change this number with ##LongSound prefs# from the main #Preferences menu; "
  357. "the sound file itself can contain several hours of sound.")
  358. MAN_END
  359. MAN_BEGIN (U"Macintosh sound files", U"ppgb", 20110131)
  360. INTRO (U"A way for storing a @Sound object on disk.")
  361. ENTRY (U"File format")
  362. NORMAL (U"The double-clickable sound file of the Macintosh (8 bits per sample). "
  363. "Cannot be ported to other machines, because the sound is in the @@resource fork@.")
  364. ENTRY (U"Reading")
  365. NORMAL (U"With @@Read from file...@.")
  366. NORMAL (U"To read a Sound from a Macintosh sound file on disk, use @@Read from file...@ (Macintosh only).")
  367. NORMAL (U"The 8-bit sample values are divided by 128 so that the amplitude "
  368. "of the resulting Sound is between –1.0 and +1.0.")
  369. NORMAL (U"The resulting Sound will appear in the list of objects; "
  370. "its name will be equal to the file name, without extension.")
  371. ENTRY (U"Saving")
  372. NORMAL (U"With ##Save as Mac sound file...#. Praat asks you for a file name. "
  373. "After you click OK, 0.5 is added to the samples of the Sound, "
  374. "they are multiplied by 128 and quantized between 0 and 255; "
  375. "the result is written to the file in 8-bit linear Macintosh sound-file format.")
  376. NORMAL (U"To avoid clipping, keep the absolute amplitude below 1.000. "
  377. "If the maximum sound pressure level is 91 dB (top = 127), "
  378. "the quantization threshold for a sine wave is (top = 1/2) 43 dB.")
  379. MAN_END
  380. MAN_BEGIN (U"Open long sound file...", U"ppgb", 19980730)
  381. INTRO (U"A command in the @@Open menu@ that creates a @LongSound object.")
  382. NORMAL (U"The file will be opened for reading only. The file stays open until you remove the LongSound object.")
  383. MAN_END
  384. MAN_BEGIN (U"Sesam/LVS files", U"ppgb", 20170828)
  385. INTRO (U"A way for storing a @Sound object on disk.")
  386. ENTRY (U"File format")
  387. NORMAL (U"The sound files used by the SESAM and LVS programs. Each sample is normally quantized into 12 bits.")
  388. ENTRY (U"Reading")
  389. NORMAL (U"To read a #Sound from a Sesam file on disk, use @@Read from file...@. "
  390. "The file name is expected to end in \".sdf\" or \".SDF\".")
  391. NORMAL (U"The 12-bit sample values are divided by 2048 so that the amplitude "
  392. "of the resulting Sound is between -1.0 and +1.0.")
  393. NORMAL (U"The resulting #Sound will appear in the List of Objects; "
  394. "its name will be equal to the file name, without extension.")
  395. NORMAL (U"If the sound was encoded in 16 bits per sample, you should divide by 16 after reading "
  396. "(with $$Formula: ~ self / 16$)")
  397. ENTRY (U"Saving")
  398. NORMAL (U"With ##Save as Sesam file...#. Praat then asks you for a file name. "
  399. "After you click OK, the samples of the Sound are multiplied by 2048 "
  400. "and quantized between -2048 and 2047; "
  401. "the result is written to the file in 12-bit LVS and Sesam format.")
  402. NORMAL (U"To avoid clipping, keep the absolute amplitude below 1.000. "
  403. "If the maximum sound pressure level is 91 dB (top = 2047), "
  404. "the quantization threshold is (top = 1/2) 19 dB.")
  405. NORMAL (U"If you prefer 16-bit encoding, you should multiply by 16 before saving "
  406. "(with $$Formula: ~ self * 16$)")
  407. MAN_END
  408. }
  409. /* End of file manual_soundFiles.cpp */