Mercurial > SDL_sound_CoreAudio
comparison SDL_sound.h @ 485:137c0b00ea4c
Added Sound_NewSampleFromMem(), and implementation of RWops pooling.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 27 Feb 2005 19:53:25 +0000 |
parents | 3e705c9180e5 |
children | a0bb7a9c05b1 |
comparison
equal
deleted
inserted
replaced
484:1c09756bc038 | 485:137c0b00ea4c |
---|---|
450 const char *ext, | 450 const char *ext, |
451 Sound_AudioInfo *desired, | 451 Sound_AudioInfo *desired, |
452 Uint32 bufferSize); | 452 Uint32 bufferSize); |
453 | 453 |
454 /** | 454 /** |
455 * \fn Sound_Sample *Sound_NewSampleFromMem(const Uint8 *data, Sound_AudioInfo *desired, Uint32 bufferSize) | |
456 * \brief Start decoding a new sound sample from a file on disk. | |
457 * | |
458 * This is identical to Sound_NewSample(), but it creates an SDL_RWops for you | |
459 * from the (size) bytes of memory referenced by (data). | |
460 * | |
461 * This can pool RWops structures, so it may fragment the heap less over time | |
462 * than using SDL_RWFromMem(). | |
463 * | |
464 * \param filename file containing sound data. | |
465 * \param desired Format to convert sound data into. Can usually be NULL, | |
466 * if you don't need conversion. | |
467 * \param bufferSize size, in bytes, of initial read buffer. | |
468 * \return Sound_Sample pointer, which is used as a handle to several other | |
469 * SDL_sound APIs. NULL on error. If error, use | |
470 * Sound_GetError() to see what went wrong. | |
471 * | |
472 * \sa Sound_NewSample | |
473 * \sa Sound_SetBufferSize | |
474 * \sa Sound_Decode | |
475 * \sa Sound_DecodeAll | |
476 * \sa Sound_Seek | |
477 * \sa Sound_Rewind | |
478 * \sa Sound_FreeSample | |
479 */ | |
480 SNDDECLSPEC Sound_Sample * SDLCALL Sound_NewSampleFromMem(const Uint8 *data, | |
481 Uint32 size, | |
482 const char *ext, | |
483 Sound_AudioInfo *desired, | |
484 Uint32 bufferSize); | |
485 | |
486 | |
487 /** | |
455 * \fn Sound_Sample *Sound_NewSampleFromFile(const char *filename, Sound_AudioInfo *desired, Uint32 bufferSize) | 488 * \fn Sound_Sample *Sound_NewSampleFromFile(const char *filename, Sound_AudioInfo *desired, Uint32 bufferSize) |
456 * \brief Start decoding a new sound sample from a file on disk. | 489 * \brief Start decoding a new sound sample from a file on disk. |
457 * | 490 * |
458 * This is identical to Sound_NewSample(), but it creates an SDL_RWops for you | 491 * This is identical to Sound_NewSample(), but it creates an SDL_RWops for you |
459 * from the file located in (filename). Note that (filename) is specified in | 492 * from the file located in (filename). Note that (filename) is specified in |
460 * platform-dependent notation. ("C:\\music\\mysong.mp3" on windows, and | 493 * platform-dependent notation. ("C:\\music\\mysong.mp3" on windows, and |
461 * "/home/icculus/music/mysong.mp3" or whatever on Unix, etc.) | 494 * "/home/icculus/music/mysong.mp3" or whatever on Unix, etc.) |
462 * Sound_NewSample()'s "ext" parameter is gleaned from the contents of | 495 * Sound_NewSample()'s "ext" parameter is gleaned from the contents of |
463 * (filename). | 496 * (filename). |
497 * | |
498 * This can pool RWops structures, so it may fragment the heap less over time | |
499 * than using SDL_RWFromFile(). | |
464 * | 500 * |
465 * \param filename file containing sound data. | 501 * \param filename file containing sound data. |
466 * \param desired Format to convert sound data into. Can usually be NULL, | 502 * \param desired Format to convert sound data into. Can usually be NULL, |
467 * if you don't need conversion. | 503 * if you don't need conversion. |
468 * \param bufferSize size, in bytes, of initial read buffer. | 504 * \param bufferSize size, in bytes, of initial read buffer. |