Skip to content

Commit d7bac59

Browse files
committedDec 20, 2016
Added pcm 16 as wav
1 parent 03fb237 commit d7bac59

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed
 

‎EZAudio/EZAudio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ FOUNDATION_EXPORT const unsigned char EZAudioVersionString[];
253253
Bit Rate : 262k
254254
Sample Encoding: 16-bit Signed Integer PCM
255255
*/
256-
+ (AudioStreamBasicDescription)stereoPCMFormatWithChannels:(int)channels andSampleRate:(float)sampleRate;
256+
+ (AudioStreamBasicDescription)PCMFormatIntegerWithChannels:(int)channels andSampleRate:(float)sampleRate;
257257

258258
//------------------------------------------------------------------------------
259259

‎EZAudio/EZAudio.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ + (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate
121121

122122
//------------------------------------------------------------------------------
123123

124-
+ (AudioStreamBasicDescription)stereoPCMFormatWithChannels:(int)channels andSampleRate:(float)sampleRate
124+
+ (AudioStreamBasicDescription)PCMFormatIntegerWithChannels:(int)channels andSampleRate:(float)sampleRate
125125
{
126-
return [EZAudioUtilities stereoPCMFormatWithChannels:channels andSampleRate:sampleRate];
126+
return [EZAudioUtilities PCMFormatIntegerWithChannels:channels andSampleRate:sampleRate];
127127
}
128128

129129
//------------------------------------------------------------------------------
@@ -311,4 +311,4 @@ + (void)freeCircularBuffer:(TPCircularBuffer *)circularBuffer
311311

312312
//------------------------------------------------------------------------------
313313

314-
@end
314+
@end

‎EZAudio/EZAudioUtilities.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ typedef NSRect EZRect;
230230
Bit Rate : 262k
231231
Sample Encoding: 16-bit Signed Integer PCM
232232
*/
233-
+ (AudioStreamBasicDescription)stereoPCMFormatWithChannels:(int)channels andSampleRate:(float)sampleRate;
233+
+ (AudioStreamBasicDescription)PCMFormatIntegerWithChannels:(int)channels andSampleRate:(float)sampleRate;
234234

235235
//------------------------------------------------------------------------------
236236

‎EZAudio/EZAudioUtilities.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ + (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate
284284

285285
//------------------------------------------------------------------------------
286286

287-
+ (AudioStreamBasicDescription)stereoPCMFormatWithChannels:(int)channels andSampleRate:(float)sampleRate
287+
+ (AudioStreamBasicDescription)PCMFormatIntegerWithChannels:(int)channels andSampleRate:(float)sampleRate
288288
{
289289
AudioStreamBasicDescription asbd;
290290
UInt32 byteSize = 2;

‎EZAudio/EZRecorder.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ typedef NS_ENUM(NSInteger, EZRecorderFileType)
5353
/**
5454
Recording format that describes WAV file types. These are uncompressed, LPCM files that are completely lossless, but are large in file size.
5555
*/
56-
EZRecorderFileTypeWAV
56+
EZRecorderFileTypeWAV16,
57+
/**
58+
Recording format that describes WAV file types. These are uncompressed, LPCM files that are completely lossless, but are large in file size.
59+
*/
60+
EZRecorderFileTypeWAV,
5761
};
5862

5963
//------------------------------------------------------------------------------
@@ -361,4 +365,4 @@ typedef NS_ENUM(NSInteger, EZRecorderFileType)
361365
*/
362366
- (void)closeAudioFile;
363367

364-
@end
368+
@end

‎EZAudio/EZRecorder.m

+8-5
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,16 @@ + (AudioStreamBasicDescription)formatForFileType:(EZRecorderFileType)fileType
232232
sampleRate:sourceFormat.mSampleRate];
233233
break;
234234

235-
case EZRecorderFileTypeWAV:
236-
asbd = [EZAudioUtilities stereoPCMFormatWithChannels:sourceFormat.mChannelsPerFrame
235+
case EZRecorderFileTypeWAV16:
236+
asbd = [EZAudioUtilities PCMFormatIntegerWithChannels:sourceFormat.mChannelsPerFrame
237237
andSampleRate:sourceFormat.mSampleRate];
238238
break;
239-
239+
240+
case EZRecorderFileTypeWAV:
241+
asbd = [EZAudioUtilities monoCanonicalFormatWithSampleRate:sourceFormat.mSampleRate];
242+
break;
240243
default:
241-
asbd = [EZAudioUtilities stereoCanonicalNonInterleavedFormatWithSampleRate:sourceFormat.mSampleRate];
244+
asbd = [EZAudioUtilities monoCanonicalFormatWithSampleRate:sourceFormat.mSampleRate];
242245
break;
243246
}
244247
return asbd;
@@ -454,4 +457,4 @@ - (void)setClientFormat:(AudioStreamBasicDescription)clientFormat
454457
self.info->clientFormat = clientFormat;
455458
}
456459

457-
@end
460+
@end

0 commit comments

Comments
 (0)
Please sign in to comment.