| 1 | #cxx . . $ `<file>/fon/Sound.h`/ifndef _Sound_h_ |
| 2 | #define _Sound_h_cxx . . $ `fon/Sound.h:2:9`! |
| 3 | /* Sound.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2005,2006-2008,2010-2019,2021-2025 Paul Boersma |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | * See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | /* Sound inherits from Vector */ |
| 22 | /* A Sound is a sampled signal, not quantized. */ |
| 23 | #include "Vector.h"cxx . . $ `<file>/fon/Vector.h`/ |
| 24 | #include "Collection.h"cxx . . $ `<file>/sys/Collection.h`/ |
| 25 | |
| 26 | #include "Sound_enums.h"cxx . . $ `<file>/fon/Sound_enums.h`/ |
| 27 | |
| 28 | Thing_definecxx . . $ ClassInfo# (Sound, Vector) { |
| 29 | void v1_infocxx . . $ structSound#v1_info(49f6e7a06ebc5aa8). () |
| 30 | override; |
| 31 | bool v_hasGetMatrixcxx . . $ structSound#v_hasGetMatrix(50ce9a9e25b4a850). () const |
| 32 | override { return true; } |
| 33 | double v_getMatrixcxx . . $ structSound#v_getMatrix(f7a1f362ba849873). (integercxx . . $ integer# irow, integercxx . . $ integer# icol) const |
| 34 | override; |
| 35 | bool v_hasGetFunction2cxx . . $ structSound#v_hasGetFunction2(50ce9a9e25b4a850). () const |
| 36 | override { return true; } |
| 37 | double v_getFunction2cxx . . $ structSound#v_getFunction2(726307d3d9a4aee5). (double x, double y) const |
| 38 | override; |
| 39 | int v_domainQuantitycxx . . $ structSound#v_domainQuantity(455f465bc33b4cdf). () const |
| 40 | override { return MelderQuantity_TIME_SECONDScxx . . $ `melder/melder_quantity.h:22:9`!; } |
| 41 | }; |
| 42 | |
| 43 | /* Attributes: |
| 44 | xmin // Start time (seconds). |
| 45 | xmax // End time (seconds). |
| 46 | nx // Number of samples. |
| 47 | dx // Sampling period (seconds). |
| 48 | x1 // Time of first sample (seconds). |
| 49 | ymin == 1 // Left or only channel. |
| 50 | ymax // Right or only channels. |
| 51 | ny // Number of channels. |
| 52 | dy == 1; y1 == 1 // y is channel number (1 = left or mono; 2 = right). |
| 53 | z [i] [...] // Amplitude. |
| 54 | z may be replaced (e.g., in pasting). |
| 55 | */ |
| 56 | |
| 57 | autoSoundcxx . . $ autoSound# Sound_createcxx . . $ Sound_create(39ab106d6b9a0135). (integercxx . . $ integer# numberOfChannels, double xmin, double xmax, integercxx . . $ integer# nx, double dx, double x1); |
| 58 | /* |
| 59 | Function: |
| 60 | return a new silent Sound. |
| 61 | Preconditions: |
| 62 | xmax > xmin; |
| 63 | nx >= 1; |
| 64 | dx > 0.0; |
| 65 | Postconditions: |
| 66 | thy xmin == xmin; |
| 67 | thy xmax == xmax; |
| 68 | thy nx == nx; |
| 69 | thy dx == dx; |
| 70 | thy x1 == x1; |
| 71 | thy ymin = 1.0; |
| 72 | thy ymax = numberOfChannels; |
| 73 | thy ny = numberOfChannels; |
| 74 | thy dx = 1.0; |
| 75 | thy x1 = 1.0; |
| 76 | thy z [i] [1..nx] == 0.0; |
| 77 | */ |
| 78 | |
| 79 | autoSoundcxx . . $ autoSound# Sound_createSimplecxx . . $ Sound_createSimple(fcb03a673f737ce). (integercxx . . $ integer# numberOfChannels, double duration, double samplingFrequency); |
| 80 | /* |
| 81 | Function: |
| 82 | return a new silent Sound. |
| 83 | Preconditions: |
| 84 | duration > 0.0; |
| 85 | samplingFrequency > 0.0; |
| 86 | Postconditions: |
| 87 | thy xmin == 0.0; |
| 88 | thy xmax == duration; |
| 89 | thy nx == Melder_iround (duration * samplingFrequency); |
| 90 | thy dx == 1 / samplingFrequency; |
| 91 | thy x1 == 0.5 * thy dx; // Centre of first sampling period. |
| 92 | thy ymin = 1.0; |
| 93 | thy ymax = numberOfChannels; |
| 94 | thy ny = numberOfChannels; |
| 95 | thy dx = 1.0; |
| 96 | thy x1 = 1.0; |
| 97 | thy z [i] [1..nx] == 0.0; |
| 98 | */ |
| 99 | |
| 100 | autoSoundcxx . . $ autoSound# Sound_convertToMonocxx . . $ Sound_convertToMono(4e9053a6db58af83). (constSoundcxx . . $ constSound# me); |
| 101 | autoSoundcxx . . $ autoSound# Sound_convertToStereocxx . . $ Sound_convertToStereo(4e9053a6db58af83). (constSoundcxx . . $ constSound# me); |
| 102 | autoSoundcxx . . $ autoSound# Sound_extractChannelcxx . . $ Sound_extractChannel(fdb1ba3dfee1bd33). (constSoundcxx . . $ constSound# me, integercxx . . $ integer# ichannel); |
| 103 | autoSoundcxx . . $ autoSound# Sound_extractChannelscxx . . $ Sound_extractChannels(854b47aef71dd5a5). (constSoundcxx . . $ constSound# me, constINTVECVUcxx . . $ constINTVECVU# const& channelNumbers); |
| 104 | autoSoundcxx . . $ autoSound# Sounds_combineToStereocxx . . $ Sounds_combineToStereo(1972390e3e72148d). (OrderedOfcxx . . $ OrderedOf#<structSoundcxx . . $ structSound#>* me); |
| 105 | |
| 106 | /* Levels for Sampled_getValueAtSample (me, index, level, unit) */ |
| 107 | #define Sound_LEVEL_MONOcxx . . $ `fon/Sound.h:107:9`! 0 |
| 108 | #define Sound_LEVEL_LEFTcxx . . $ `fon/Sound.h:108:9`! 1 |
| 109 | #define Sound_LEVEL_RIGHTcxx . . $ `fon/Sound.h:109:9`! 2 |
| 110 | |
| 111 | autoSoundcxx . . $ autoSound# Sound_upsamplecxx . . $ Sound_upsample(4e9053a6db58af83). (constSoundcxx . . $ constSound# me); /* By a factor 2. */ |
| 112 | |
| 113 | autoSoundcxx . . $ autoSound# Sound_resamplecxx . . $ Sound_resample(872961da5f5e69e5). (constSoundcxx . . $ constSound# me, double samplingFrequency, integercxx . . $ integer# precision); |
| 114 | /* |
| 115 | Method: |
| 116 | precision <= 1: linear interpolation. |
| 117 | precision >= 2: sinx/x interpolation with maximum depth equal to 'precision'. |
| 118 | */ |
| 119 | |
| 120 | autoSoundcxx . . $ autoSound# Sounds_appendcxx . . $ Sounds_append(87708204a3e78041). (constSoundcxx . . $ constSound# me, double silenceDuration, constSoundcxx . . $ constSound# thee); |
| 121 | /* |
| 122 | Function: |
| 123 | append two Sounds. |
| 124 | Failure: |
| 125 | my dx != thy dx: "Sampling frequencies do not match." |
| 126 | Postconditions: |
| 127 | result -> xmin == 0; |
| 128 | result -> xmax == result -> nx * my dx; |
| 129 | result -> nx == my nx + thy nx + Melder_iround (silenceDuration / my dx); |
| 130 | result -> dx == my dx; |
| 131 | result -> x1 == 0.5 * my dx; |
| 132 | for (i = 1..my nx) |
| 133 | result -> z [1] [i] == my z [1] [i] |
| 134 | for (i = 1..thy nx) |
| 135 | result -> z [1] [i + my nx + Melder_iround (silenceDuration / my dx)] == thy z [1] [i] |
| 136 | */ |
| 137 | |
| 138 | autoSoundcxx . . $ autoSound# Sounds_convolvecxx . . $ Sounds_convolve(b7360aaa447e63e). (constSoundcxx . . $ constSound# me, constSoundcxx . . $ constSound# thee, kSounds_convolve_scalingcxx . . $ kSounds_convolve_scaling# scaling, kSounds_convolve_signalOutsideTimeDomaincxx . . $ kSounds_convolve_signalOutsideTimeDomain# signalOutsideTimeDomain); |
| 139 | /* |
| 140 | Function: |
| 141 | convolve two Sounds. |
| 142 | Failure: |
| 143 | my dx != thy dx: "Sampling frequencies do not match." |
| 144 | Postconditions: |
| 145 | result -> xmin == my xmin + thy xmin; |
| 146 | result -> xmax == my xmax + thy xmax; |
| 147 | result -> nx == my nx + thy nx - 1; |
| 148 | result -> dx == my dx; |
| 149 | result -> x1 == my x1 + thy x1; |
| 150 | for (i = 1..result -> nx) |
| 151 | result -> z [1] [i] == result -> dx * |
| 152 | sum (j = 1..i, my z [1] [j] * thy z [1] [i - j + 1]) |
| 153 | */ |
| 154 | autoSoundcxx . . $ autoSound# Sounds_crossCorrelatecxx . . $ Sounds_crossCorrelate(b7360aaa447e63e). (constSoundcxx . . $ constSound# me, constSoundcxx . . $ constSound# thee, kSounds_convolve_scalingcxx . . $ kSounds_convolve_scaling# scaling, kSounds_convolve_signalOutsideTimeDomaincxx . . $ kSounds_convolve_signalOutsideTimeDomain# signalOutsideTimeDomain); |
| 155 | autoSoundcxx . . $ autoSound# Sounds_crossCorrelate_shortcxx . . $ Sounds_crossCorrelate_short(619b4afbd70d9931). (constSoundcxx . . $ constSound# me, constSoundcxx . . $ constSound# thee, double tmin, double tmax, bool normalize); |
| 156 | autoSoundcxx . . $ autoSound# Sound_autoCorrelatecxx . . $ Sound_autoCorrelate(48c242b038311e1f). (constSoundcxx . . $ constSound# me, kSounds_convolve_scalingcxx . . $ kSounds_convolve_scaling# scaling, kSounds_convolve_signalOutsideTimeDomaincxx . . $ kSounds_convolve_signalOutsideTimeDomain# signalOutsideTimeDomain); |
| 157 | |
| 158 | void Sound_shiftTimesToBetweenZeroAndPhysicalDurationcxx . . $ Sound_shiftTimesToBetweenZeroAndPhysicalDuration(88106389304369e6). (mutableSoundcxx . . $ mutableSound# me); |
| 159 | |
| 160 | double Sound_getRootMeanSquarecxx . . $ Sound_getRootMeanSquare(511c4e44d03f8807). (constSoundcxx . . $ constSound# me, double xmin, double xmax); |
| 161 | double Sound_getEnergycxx . . $ Sound_getEnergy(511c4e44d03f8807). (constSoundcxx . . $ constSound# me, double xmin, double xmax); |
| 162 | double Sound_getPowercxx . . $ Sound_getPower(511c4e44d03f8807). (constSoundcxx . . $ constSound# me, double xmin, double xmax); |
| 163 | double Sound_getEnergyInAircxx . . $ Sound_getEnergyInAir(9577c4e030d3505d). (constSoundcxx . . $ constSound# me); |
| 164 | double Sound_getPowerInAircxx . . $ Sound_getPowerInAir(9577c4e030d3505d). (constSoundcxx . . $ constSound# me); |
| 165 | double Sound_getIntensity_dBcxx . . $ Sound_getIntensity_dB(9577c4e030d3505d). (constSoundcxx . . $ constSound# me); |
| 166 | |
| 167 | double Sound_getNearestZeroCrossingcxx . . $ Sound_getNearestZeroCrossing(f92830f351830df8). (constSoundcxx . . $ constSound# me, double position, integercxx . . $ integer# ichannel); |
| 168 | void Sound_setZerocxx . . $ Sound_setZero(31bbd7258342aec7). (mutableSoundcxx . . $ mutableSound# me, double tmin, double tmax, bool roundTimesToNearestZeroCrossing); |
| 169 | |
| 170 | autoSoundcxx . . $ autoSound# Sound_createAsPureTonecxx . . $ Sound_createAsPureTone(961256c6deadb130). (integercxx . . $ integer# numberOfChannels, double startingTime, double endTime, |
| 171 | double sampleRate, double frequency, double amplitude, double fadeInDuration, double fadeOutDuration); |
| 172 | autoSoundcxx . . $ autoSound# Sound_createAsToneComplexcxx . . $ Sound_createAsToneComplex(2a3ca0e83d185f95). (double startingTime, double endTime, |
| 173 | double sampleRate, int phase, double frequencyStep, |
| 174 | double firstFrequency, double ceiling, integercxx . . $ integer# numberOfComponents); |
| 175 | /* Values for `phase' parameter: */ |
| 176 | #define Sound_TONE_COMPLEX_SINEcxx . . $ `fon/Sound.h:176:9`! 0 |
| 177 | #define Sound_TONE_COMPLEX_COSINEcxx . . $ `fon/Sound.h:177:9`! 1 |
| 178 | |
| 179 | void Sound_multiplyByWindowcxx . . $ Sound_multiplyByWindow(bbea490a38595013). (mutableSoundcxx . . $ mutableSound# me, kSound_windowShapecxx . . $ kSound_windowShape# windowShape); |
| 180 | void Sound_scaleIntensitycxx . . $ Sound_scaleIntensity(e59d264236af2337). (mutableSoundcxx . . $ mutableSound# me, double newAverageIntensity); |
| 181 | void Sound_overrideSamplingFrequencycxx . . $ Sound_overrideSamplingFrequency(e59d264236af2337). (mutableSoundcxx . . $ mutableSound# me, double newSamplingFrequency); |
| 182 | autoSoundcxx . . $ autoSound# Sound_extractPartcxx . . $ Sound_extractPart(e1651eb055dd2f09). (constSoundcxx . . $ constSound# me, double t1, double t2, kSound_windowShapecxx . . $ kSound_windowShape# windowShape, double relativeWidth, bool preserveTimes); |
| 183 | autoSoundcxx . . $ autoSound# Sound_extractPartForOverlapcxx . . $ Sound_extractPartForOverlap(a9298ecf594d39cf). (constSoundcxx . . $ constSound# me, double t1, double t2, double overlap); |
| 184 | void Sound_filterWithFormantscxx . . $ Sound_filterWithFormants(2aef0a9fc25232a8). (mutableSoundcxx . . $ mutableSound# me, double tmin, double tmax, |
| 185 | int numberOfFormants, double formant [], double bandwidth []); |
| 186 | autoSoundcxx . . $ autoSound# Sound_filter_oneFormantcxx . . $ Sound_filter_oneFormant(d3fc085af13920bc). (constSoundcxx . . $ constSound# me, double frequency, double bandwidth); |
| 187 | void Sound_filterWithOneFormantInplacecxx . . $ Sound_filterWithOneFormantInplace(77a4df2843109656). (mutableSoundcxx . . $ mutableSound# me, double frequency, double bandwidth); |
| 188 | |
| 189 | double Sound_computeEmphasisFactorcxx . . $ Sound_computeEmphasisFactor(922ce31e9502a5ee). (constSoundcxx . . $ constSound# me, double cutoffFrequency); |
| 190 | void Sound_preEmphasize_inplacecxx . . $ Sound_preEmphasize_inplace(e59d264236af2337). (mutableSoundcxx . . $ mutableSound# me, double cutoffFrequency); |
| 191 | void Sound_deEmphasize_inplacecxx . . $ Sound_deEmphasize_inplace(e59d264236af2337). (Soundcxx . . $ Sound# me, double cutoffFrequency); |
| 192 | autoSoundcxx . . $ autoSound# Sound_filter_preemphasiscxx . . $ Sound_filter_preemphasis(5bde49e4335e9a5a). (constSoundcxx . . $ constSound# me, double cutoffFrequency); |
| 193 | autoSoundcxx . . $ autoSound# Sound_filter_deemphasiscxx . . $ Sound_filter_deemphasis(5bde49e4335e9a5a). (constSoundcxx . . $ constSound# me, double cutoffFrequency); |
| 194 | |
| 195 | void Sound_reversecxx . . $ Sound_reverse(77a4df2843109656). (mutableSoundcxx . . $ mutableSound# me, double tmin, double tmax); |
| 196 | |
| 197 | void Sound_drawcxx . . $ Sound_draw(9ce2a9dfe752ed09). (constSoundcxx . . $ constSound# me, Graphicscxx . . $ Graphics# g, |
| 198 | double tmin, double tmax, double minimum, double maximum, bool garnish, conststring32cxx . . $ conststring32# method); |
| 199 | /* For method, see Vector_draw. */ |
| 200 | |
| 201 | autoMatrixcxx . . $ autoMatrix# Sound_to_Matrixcxx . . $ Sound_to_Matrix(593cc862e33913cb). (constSoundcxx . . $ constSound# me); |
| 202 | /* |
| 203 | Create a Matrix from a Sound, |
| 204 | with deep copy of all its Matrix attributes, except class information and methods. |
| 205 | */ |
| 206 | |
| 207 | autoSoundcxx . . $ autoSound# Matrix_to_Soundcxx . . $ Matrix_to_Sound(abc428493b3c02a4). (constMatrixcxx . . $ constMatrix# me); |
| 208 | |
| 209 | autoSoundcxx . . $ autoSound# Matrix_to_Sound_monocxx . . $ Matrix_to_Sound_mono(5f0ff142d6a3cd23). (constMatrixcxx . . $ constMatrix# me, integercxx . . $ integer# row); |
| 210 | /* |
| 211 | Function: |
| 212 | create a Sound from one row of a Matrix. |
| 213 | "row" is forced inside the segment [1, my ny]; |
| 214 | negative values count from the last row; |
| 215 | e.g., if "row" is -1, the last row is taken. |
| 216 | Postconditions: |
| 217 | thy xmin == my xmin; |
| 218 | thy xmax == my xmax; |
| 219 | thy nx == my nx; |
| 220 | thy dx == my dx; |
| 221 | thy x1 == my x1; |
| 222 | thy ymin ymax ny dy y1 == 1; |
| 223 | thy z [1] [...] == my z [row] [...]; |
| 224 | */ |
| 225 | |
| 226 | inline autoSoundcxx . . $ autoSound# Sound_clipboardcxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8).; |
| 227 | |
| 228 | /********** Sound_audio.cpp **********/ |
| 229 | |
| 230 | autoSoundcxx . . $ autoSound# Sound_record_fixedTimecxx . . $ Sound_record_fixedTime(6947fa21466ac0c2). (int inputSource, |
| 231 | double gain, double balance, double samplingFrequency, double duration); |
| 232 | /* |
| 233 | Function: |
| 234 | record a sound without user interaction, synchronously (i.e., return when recording finsishes). |
| 235 | Arguments: |
| 236 | inputSource: |
| 237 | <=0 = do not change (may be set by Audio Control Panel). |
| 238 | 1 = microphone. |
| 239 | 2 = line. |
| 240 | 3 = digital. |
| 241 | If the input source selection fails, the microphone is used. |
| 242 | gain: |
| 243 | <0.0 = do not change. |
| 244 | 0.0 = minimum. |
| 245 | 1.0 = maximum. |
| 246 | balance: |
| 247 | <0.0 = do not change. |
| 248 | 0.0 = left channel only. |
| 249 | 0.5 = mid balance. |
| 250 | 1.0 = right channel only. |
| 251 | samplingFrequency: |
| 252 | <=0.0 = do not change. |
| 253 | must be one of the sampling frequencies supported by the hardware. |
| 254 | duration: |
| 255 | positive time in seconds. |
| 256 | Return value: |
| 257 | the resulting Sound. |
| 258 | Failures: |
| 259 | Hardware does not support sampling frequency. |
| 260 | Duration must be positive. |
| 261 | Duration too long (out of memory). |
| 262 | Usage: |
| 263 | batch; in an interactive environment, it is better to use SoundRecorder_create, |
| 264 | and wait for broadcastPublication(). |
| 265 | */ |
| 266 | |
| 267 | typedef MelderCallbackcxx . . $ MelderCallback# <int, structThingcxx . . $ structThing# /* boss */, int /* phase */, double /* tmin */, double /* tmax */, double /* t */> Sound_PlayCallbackcxx . . $ Sound_PlayCallback#; |
| 268 | |
| 269 | void Sound_playPartcxx . . $ Sound_playPart(4a8b47ed00757136). (constSoundcxx . . $ constSound# me, double tmin, double tmax, Sound_PlayCallbackcxx . . $ Sound_PlayCallback# playCallback, Thingcxx . . $ Thing# playBoss); |
| 270 | /* |
| 271 | * Play a sound. The playing can be interrupted with the Escape key (also Command-period on the Mac). |
| 272 | * If playCallback is not null, Sound_play will call it repeatedly, with five parameters: |
| 273 | * 1. playBoss: the same value as was supplied as the last argument to Sound_playPart. |
| 274 | * 2. phase: 1 at the start, 2 while playing, 3 at the end. |
| 275 | * 3. tmin: the same tmin that was supplied as the second argument to Sound_playPart. |
| 276 | * 4. tmax: the same tmax that was supplied as the second argument to Sound_playPart. |
| 277 | * 5. t: the time (probably between tmin and tmax) at which the sound is playing. |
| 278 | * The usage of playCallback is as follows. Suppose we are an editor that wants to show a moving |
| 279 | * cursor while we play a sound: |
| 280 | * Sound_playPart (my sound, my startSelection, my endSelection, thePlayCallback, me); |
| 281 | * We gave ourselves as the playClosure, so that the message will arrive with us: |
| 282 | * int thePlayCallback (SoundEditor me, int phase, double tmin, double tmax, double t) { |
| 283 | * if (phase == 1) { |
| 284 | * Melder_assert (t == tmin); |
| 285 | * drawPlayCursor (me, my playCursor = t); |
| 286 | * } else if (phase == 2) { |
| 287 | * undrawPlayCursor (me, my playCursor); |
| 288 | * drawPlayCursor (me, my playCursor = t); |
| 289 | * } else { |
| 290 | * undrawPlayCursor (me, t); |
| 291 | * moveCursor (me, t); |
| 292 | * if (t < tmax) { Melder_casual (U"Sound play interrupted."); } |
| 293 | * } |
| 294 | * return 1; |
| 295 | * } |
| 296 | * The playCallback procedure usually returns 1, because the sound should continue playing. |
| 297 | * If playCallback returns 0 instead, Sound_play will interrupt the play and return. |
| 298 | * Sound_playPart returns the time at which playing stopped. If playing was not interrupted, it returns tmax. |
| 299 | * |
| 300 | * Sound_playPart () usually runs asynchronously, and kills an already playing sound. |
| 301 | */ |
| 302 | void Sound_playcxx . . $ Sound_play(8cd75def0156a342). (constSoundcxx . . $ constSound# me, Sound_PlayCallbackcxx . . $ Sound_PlayCallback# playCallback, Thingcxx . . $ Thing# playBoss); |
| 303 | /* The same as Sound_playPart (me, my xmin, my xmax, playCallback, playBoss); */ |
| 304 | |
| 305 | /********** Sound_files.cpp **********/ |
| 306 | |
| 307 | /* To avoid clipping, keep the absolute amplitude below 1.000. */ |
| 308 | /* All are mono or stereo PCM. */ |
| 309 | void Sound_saveAsAudioFilecxx . . $ Sound_saveAsAudioFile(5caabbbba2b52333). (constSoundcxx . . $ constSound# me, MelderFilecxx . . $ MelderFile# file, int audioFileType, int numberOfBitsPerSamplePoint); |
| 310 | void Sound_saveAsKayFilecxx . . $ Sound_saveAsKayFile(6683fe382a6f5fcb). (constSoundcxx . . $ constSound# me, MelderFilecxx . . $ MelderFile# file); // 16-bit |
| 311 | void Sound_saveAsSesamFilecxx . . $ Sound_saveAsSesamFile(6683fe382a6f5fcb). (constSoundcxx . . $ constSound# me, MelderFilecxx . . $ MelderFile# file); // 12-bit SESAM/LVS |
| 312 | |
| 313 | autoSoundcxx . . $ autoSound# Sound_readFromSoundFilecxx . . $ Sound_readFromSoundFile(93fb99dfd38ebabb). (MelderFilecxx . . $ MelderFile# file); // AIFF, WAV, NeXT/Sun, or NIST |
| 314 | autoDaatacxx . . $ autoDaata# Sound_readFromAnyKayFilecxx . . $ Sound_readFromAnyKayFile(da9ba57d6e09e2a7). (MelderFilecxx . . $ MelderFile# file); // 16-bit |
| 315 | autoSoundcxx . . $ autoSound# Sound_readFromSesamFilecxx . . $ Sound_readFromSesamFile(93fb99dfd38ebabb). (MelderFilecxx . . $ MelderFile# file); // 12-bit SESAM/LVS |
| 316 | autoSoundcxx . . $ autoSound# Sound_readFromBellLabsFilecxx . . $ Sound_readFromBellLabsFile(93fb99dfd38ebabb). (MelderFilecxx . . $ MelderFile# file); // 16-bit |
| 317 | autoSoundcxx . . $ autoSound# Sound_readFromRawAlawFilecxx . . $ Sound_readFromRawAlawFile(93fb99dfd38ebabb). (MelderFilecxx . . $ MelderFile# file); |
| 318 | autoSoundcxx . . $ autoSound# Sound_readFromMovieFilecxx . . $ Sound_readFromMovieFile(93fb99dfd38ebabb). (MelderFilecxx . . $ MelderFile# file); |
| 319 | |
| 320 | autoSoundcxx . . $ autoSound# Sound_readFromRawSoundFilecxx . . $ Sound_readFromRawSoundFile(46f6ae096a887a63). (MelderFilecxx . . $ MelderFile# file, int encoding, int numberOfChannels, double sampleRate); |
| 321 | /* |
| 322 | 'encoding' is any of the following: |
| 323 | Melder_LINEAR_8_SIGNED |
| 324 | Melder_LINEAR_8_UNSIGNED |
| 325 | Melder_LINEAR_16_BIG_ENDIAN |
| 326 | Melder_LINEAR_16_LITTLE_ENDIAN |
| 327 | Melder_MULAW |
| 328 | Melder_ALAW |
| 329 | 'numberOfChannels' is 1 (mono) or 2 (stereo) |
| 330 | 'sampleRate' is in hertz |
| 331 | */ |
| 332 | void Sound_saveAsRawSoundFilecxx . . $ Sound_saveAsRawSoundFile(c265c8f135494a56). (constSoundcxx . . $ constSound# me, MelderFilecxx . . $ MelderFile# file, int encoding); |
| 333 | /* |
| 334 | 'encoding' is any of the following: |
| 335 | Melder_LINEAR_8_SIGNED |
| 336 | Melder_LINEAR_8_UNSIGNED |
| 337 | Melder_LINEAR_16_BIG_ENDIAN |
| 338 | Melder_LINEAR_16_LITTLE_ENDIAN |
| 339 | 'me' must exist |
| 340 | */ |
| 341 | |
| 342 | /********** Sound_enhance.cpp **********/ |
| 343 | |
| 344 | autoSoundcxx . . $ autoSound# Sound_lengthen_overlapAddcxx . . $ Sound_lengthen_overlapAdd(a9298ecf594d39cf). (constSoundcxx . . $ constSound# me, double fmin, double fmax, double factor); |
| 345 | autoSoundcxx . . $ autoSound# Sound_deepenBandModulationcxx . . $ Sound_deepenBandModulation(654ce24bee9d807b). (constSoundcxx . . $ constSound# me, double enhancement_dB, |
| 346 | double flow, double fhigh, double slowModulation, double fastModulation, double bandSmoothing); |
| 347 | |
| 348 | /* |
| 349 | Abstract. |
| 350 | */ |
| 351 | Collection_definecxx . . $ SomeThingHandle# (SoundList, OrderedOf, Sound) { |
| 352 | }; |
| 353 | |
| 354 | autoSoundcxx . . $ autoSound# Sounds_concatenatecxx . . $ Sounds_concatenate(83bbb24deeaff801). (SoundListcxx . . $ SoundList# list, double overlapTime); |
| 355 | void SoundList_playcxx . . $ SoundList_play(fc8290a8f609615f). (SoundListcxx . . $ SoundList# me, Sound_PlayCallbackcxx . . $ Sound_PlayCallback# playCallback, Thingcxx . . $ Thing# playClosure); |
| 356 | |
| 357 | /* End of file Sound.h */ |
| 358 | #endif |