Skip to content

Commit e7af11c

Browse files
committed
Code style updates and typo fix
1 parent 5fd3ca8 commit e7af11c

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

AudioFile.h

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ bool AudioFile<T>::setAudioBuffer (AudioBuffer& newBuffer)
384384

385385
if (numChannels <= 0)
386386
{
387-
assert (false && "The buffer your are trying to use has no channels");
387+
assert (false && "The buffer you are trying to use has no channels");
388388
return false;
389389
}
390390

@@ -1309,8 +1309,7 @@ T AudioFile<T>::twentyFourBitIntToSample (int32_t sample)
13091309
{
13101310
return static_cast<T> (sample) / static_cast<T> (8388608.);
13111311
}
1312-
1313-
else if(std::numeric_limits<T>::is_integer)
1312+
else if (std::numeric_limits<T>::is_integer)
13141313
{
13151314
return resampleIntegerSample<int32_t, T>(sample);
13161315
}
@@ -1327,7 +1326,7 @@ int32_t AudioFile<T>::sampleToTwentyFourBitInt (T sample)
13271326
}
13281327
else
13291328
{
1330-
return resampleIntegerSample<T, int32_t>(sample);
1329+
return resampleIntegerSample<T, int32_t> (sample);
13311330
}
13321331
}
13331332

@@ -1339,10 +1338,9 @@ T AudioFile<T>::sixteenBitIntToSample (int16_t sample)
13391338
{
13401339
return static_cast<T> (sample) / static_cast<T> (32768.);
13411340
}
1342-
1343-
else if(std::numeric_limits<T>::is_integer)
1341+
else if (std::numeric_limits<T>::is_integer)
13441342
{
1345-
return resampleIntegerSample<int16_t, T>(sample);
1343+
return resampleIntegerSample<int16_t, T> (sample);
13461344
}
13471345
}
13481346

@@ -1357,7 +1355,7 @@ int16_t AudioFile<T>::sampleToSixteenBitInt (T sample)
13571355
}
13581356
else
13591357
{
1360-
return resampleIntegerSample<T, int16_t>(sample);
1358+
return resampleIntegerSample<T, int16_t> (sample);
13611359
}
13621360
}
13631361

@@ -1373,7 +1371,7 @@ int8_t AudioFile<T>::sampleToSingleByte (T sample)
13731371
}
13741372
else
13751373
{
1376-
return resampleIntegerSample<T, int8_t>(sample);
1374+
return resampleIntegerSample<T, int8_t> (sample);
13771375
}
13781376
}
13791377

@@ -1385,10 +1383,9 @@ T AudioFile<T>::singleByteToSample (uint8_t sample)
13851383
{
13861384
return static_cast<T> (sample - 128) / static_cast<T> (128.);
13871385
}
1388-
1389-
else if(std::numeric_limits<T>::is_integer)
1386+
else if (std::numeric_limits<T>::is_integer)
13901387
{
1391-
return resampleIntegerSample<int8_t, T>(sample - 0x7F);
1388+
return resampleIntegerSample<int8_t, T> (sample - 0x7F);
13921389
}
13931390
}
13941391

@@ -1400,12 +1397,12 @@ T AudioFile<T>::singleByteToSample (int8_t sample)
14001397
{
14011398
return static_cast<T> (sample) / static_cast<T> (128.);
14021399
}
1403-
1404-
else if(std::numeric_limits<T>::is_integer)
1400+
else if (std::numeric_limits<T>::is_integer)
14051401
{
1406-
return resampleIntegerSample<int8_t, T>(sample);
1402+
return resampleIntegerSample<int8_t, T> (sample);
14071403
}
14081404
}
1405+
14091406
//=============================================================
14101407
template <class T>
14111408
T AudioFile<T>::clamp (T value, T minValue, T maxValue)

tests/FileWritingTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ bool writeTestAudioFile (int numChannels, int sampleRate, int bitDepth, AudioFil
2121

2222
// In the case of an integer representation, this value will be
2323
T maxValue;
24+
2425
if (std::is_floating_point<T>::value)
2526
{
2627
maxValue = 1;

0 commit comments

Comments
 (0)