Mercurial > sdl-ios-xcode
comparison src/audio/macrom/SDL_romaudio.c @ 2004:c27292a690b7
Mac OS 9 support for int32/float32.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 01 Sep 2006 06:01:03 +0000 |
parents | c121d94672cb |
children | 5f6550e5184f 8225ef1f4dee |
comparison
equal
deleted
inserted
replaced
2003:506851d3efa4 | 2004:c27292a690b7 |
---|---|
236 spec->format = AUDIO_S16LSB; | 236 spec->format = AUDIO_S16LSB; |
237 break; | 237 break; |
238 case AUDIO_U16MSB: | 238 case AUDIO_U16MSB: |
239 spec->format = AUDIO_S16MSB; | 239 spec->format = AUDIO_S16MSB; |
240 break; | 240 break; |
241 case AUDIO_F32LSB: | |
242 spec->format = AUDIO_F32MSB; | |
243 break; | |
241 } | 244 } |
242 SDL_CalculateAudioSpec(spec); | 245 SDL_CalculateAudioSpec(spec); |
243 | 246 |
244 /* initialize bufferCmd header */ | 247 /* initialize bufferCmd header */ |
245 memset(&header, 0, sizeof(header)); | 248 memset(&header, 0, sizeof(header)); |
257 header.sampleRate = spec->freq << 16; | 260 header.sampleRate = spec->freq << 16; |
258 header.numFrames = spec->samples; | 261 header.numFrames = spec->samples; |
259 header.encode = cmpSH; | 262 header.encode = cmpSH; |
260 | 263 |
261 /* Note that we install the 16bitLittleEndian Converter if needed. */ | 264 /* Note that we install the 16bitLittleEndian Converter if needed. */ |
262 if (spec->format == 0x8010) { | 265 if (spec->format == AUDIO_S16LSB) { |
263 header.compressionID = fixedCompression; | 266 header.compressionID = fixedCompression; |
264 header.format = k16BitLittleEndianFormat; | 267 header.format = k16BitLittleEndianFormat; |
268 } else if (spec->format == AUDIO_S32MSB) { | |
269 header.compressionID = fixedCompression; | |
270 header.format = k32BitFormat; | |
271 } else if (spec->format == AUDIO_S32LSB) { | |
272 header.compressionID = fixedCompression; | |
273 header.format = k32BitLittleEndianFormat; | |
274 } else if (spec->format == AUDIO_F32MSB) { | |
275 header.compressionID = fixedCompression; | |
276 header.format = kFloat32Format; | |
265 } | 277 } |
266 | 278 |
267 /* allocate 2 buffers */ | 279 /* allocate 2 buffers */ |
268 for (i = 0; i < 2; i++) { | 280 for (i = 0; i < 2; i++) { |
269 buffer[i] = (UInt8 *) malloc(sizeof(UInt8) * spec->size); | 281 buffer[i] = (UInt8 *) malloc(sizeof(UInt8) * spec->size); |