Mercurial > almixer_isolated
comparison ALmixer.h @ 43:a55e1f3d8f10
merged
author | Eric Wing <ewing@anscamobile.com> |
---|---|
date | Tue, 30 Aug 2011 19:43:49 -0700 |
parents | 05e5dc4817a4 |
children | 56855942fdc6 |
comparison
equal
deleted
inserted
replaced
40:2b0b55b7f8cf | 43:a55e1f3d8f10 |
---|---|
477 #define ALmixer_AudioInfo Sound_AudioInfo | 477 #define ALmixer_AudioInfo Sound_AudioInfo |
478 */ | 478 */ |
479 | 479 |
480 /* | 480 /* |
481 #define ALMIXER_DEFAULT_BUFFERSIZE 32768 | 481 #define ALMIXER_DEFAULT_BUFFERSIZE 32768 |
482 #define ALMIXER_DEFAULT_BUFFERSIZE 16384 | |
483 */ | |
482 #define ALMIXER_DEFAULT_BUFFERSIZE 4096 | 484 #define ALMIXER_DEFAULT_BUFFERSIZE 4096 |
483 */ | |
484 #define ALMIXER_DEFAULT_BUFFERSIZE 16384 | |
485 | 485 |
486 /* You probably never need to use these macros directly. */ | 486 /* You probably never need to use these macros directly. */ |
487 #ifndef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION | 487 #ifndef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION |
488 #define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE ALMIXER_DEFAULT_BUFFERSIZE * 4 | 488 #define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE ALMIXER_DEFAULT_BUFFERSIZE * 4 |
489 #else | 489 #else |
497 | 497 |
498 /** | 498 /** |
499 * Specifies the maximum number of queue buffers to use for a sound stream. | 499 * Specifies the maximum number of queue buffers to use for a sound stream. |
500 * Default Queue Buffers must be at least 2. | 500 * Default Queue Buffers must be at least 2. |
501 */ | 501 */ |
502 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 12 | 502 /* |
503 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 5 | |
504 */ | |
505 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 25 | |
503 /** | 506 /** |
504 * Specifies the number of queue buffers initially filled when first loading a stream. | 507 * Specifies the number of queue buffers initially filled when first loading a stream. |
505 * Default startup buffers should be at least 1. */ | 508 * Default startup buffers should be at least 1. */ |
509 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 8 | |
510 /* | |
506 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 2 | 511 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 2 |
512 */ | |
513 #define ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS 4 | |
507 | 514 |
508 /* | 515 /* |
509 #define ALMIXER_DECODE_STREAM 0 | 516 #define ALMIXER_DECODE_STREAM 0 |
510 #define ALMIXER_DECODE_ALL 1 | 517 #define ALMIXER_DECODE_ALL 1 |
511 */ | 518 */ |
553 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 560 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
554 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 561 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
555 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. | 562 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. |
556 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 563 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
557 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 564 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
565 * Buffer underrun conditions will also attempt to restart using this value. | |
566 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
567 * of buffers that will be queued. | |
558 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 568 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
559 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 569 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
560 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 570 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
561 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 571 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
562 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 572 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
563 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 573 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
564 */ | 574 */ |
565 extern ALMIXER_DECLSPEC ALmixer_Data* ALMIXER_CALL ALmixer_LoadSample_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 575 extern ALMIXER_DECLSPEC ALmixer_Data* ALMIXER_CALL ALmixer_LoadSample_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
566 | 576 |
567 #ifdef DOXYGEN_ONLY | 577 #ifdef DOXYGEN_ONLY |
568 /** | 578 /** |
569 * This is the loader function to load an audio resource from an RWops as a stream. | 579 * This is the loader function to load an audio resource from an RWops as a stream. |
570 * @param rw_ops The rwops pointing to the audio resource you want to load. | 580 * @param rw_ops The rwops pointing to the audio resource you want to load. |
572 * decoder to use. | 582 * decoder to use. |
573 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with | 583 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with |
574 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 584 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
575 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 585 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
576 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 586 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
587 * Buffer underrun conditions will also attempt to restart using this value. | |
588 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
589 * of buffers that will be queued. | |
577 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 590 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
578 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 591 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
579 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 592 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
580 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 593 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
581 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 594 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
582 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 595 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
583 */ | 596 */ |
584 ALmixer_Data* ALmixer_LoadStream_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 597 ALmixer_Data* ALmixer_LoadStream_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
585 #else | 598 #else |
586 #define ALmixer_LoadStream_RW(rw_ops, file_ext, buffer_size, max_queue_buffers, num_startup_buffers, access_data) ALmixer_LoadSample_RW(rw_ops,file_ext, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, access_data) | 599 #define ALmixer_LoadStream_RW(rw_ops, file_ext, buffer_size, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) ALmixer_LoadSample_RW(rw_ops,file_ext, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) |
587 #endif | 600 #endif |
588 | 601 |
589 #ifdef DOXYGEN_ONLY | 602 #ifdef DOXYGEN_ONLY |
590 /** | 603 /** |
591 * This is the loader function to completely preload an audio resource from an RWops into RAM. | 604 * This is the loader function to completely preload an audio resource from an RWops into RAM. |
597 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 610 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
598 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 611 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
599 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 612 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
600 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 613 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
601 */ | 614 */ |
602 ALmixer_Data* ALmixer_LoadAll_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALboolean access_data); | 615 ALmixer_Data* ALmixer_LoadAll_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALuint access_data); |
603 #else | 616 #else |
604 #define ALmixer_LoadAll_RW(rw_ops, file_ext, access_data) ALmixer_LoadSample_RW(rw_ops, fileext, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, access_data) | 617 #define ALmixer_LoadAll_RW(rw_ops, file_ext, access_data) ALmixer_LoadSample_RW(rw_ops, fileext, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, 0, access_data) |
605 #endif | 618 #endif |
606 | 619 |
607 /** | 620 /** |
608 * This is a general loader function to load an audio resource from a file. | 621 * This is a general loader function to load an audio resource from a file. |
609 * Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this. | 622 * Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this. |
612 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 625 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
613 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 626 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
614 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. | 627 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. |
615 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 628 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
616 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 629 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
630 * Buffer underrun conditions will also attempt to restart using this value. | |
631 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
632 * of buffers that will be queued. | |
617 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 633 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
618 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 634 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
619 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 635 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
620 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 636 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
621 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 637 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
622 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 638 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
623 */ | 639 */ |
624 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample(const char* file_name, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 640 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample(const char* file_name, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
625 | 641 |
626 #ifdef DOXYGEN_ONLY | 642 #ifdef DOXYGEN_ONLY |
627 /** | 643 /** |
628 * This is the loader function to load an audio resource from a file. | 644 * This is the loader function to load an audio resource from a file. |
629 * @param file_name The file to the audio resource you want to load. | 645 * @param file_name The file to the audio resource you want to load. |
630 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with | 646 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with |
631 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 647 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
632 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 648 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
633 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 649 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
650 * Buffer underrun conditions will also attempt to restart using this value. | |
651 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
652 * of buffers that will be queued. * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | |
653 * Buffer underrun conditions will also attempt to restart using this value. | |
654 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
655 * of buffers that will be queued. | |
634 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 656 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
635 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 657 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
636 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 658 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
637 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 659 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
638 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 660 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
639 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 661 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
640 */ | 662 */ |
641 ALmixer_Data* ALmixer_LoadStream(const char* file_name, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 663 ALmixer_Data* ALmixer_LoadStream(const char* file_name, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
642 #else | 664 #else |
643 #define ALmixer_LoadStream(file_name, buffer_size, max_queue_buffers, num_startup_buffers,access_data) ALmixer_LoadSample(file_name, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, access_data) | 665 #define ALmixer_LoadStream(file_name, buffer_size, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) ALmixer_LoadSample(file_name, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) |
644 #endif | 666 #endif |
645 | 667 |
646 #ifdef DOXYGEN_ONLY | 668 #ifdef DOXYGEN_ONLY |
647 /** | 669 /** |
648 * This is the loader function to completely preload an audio resource from a file into RAM. | 670 * This is the loader function to completely preload an audio resource from a file into RAM. |
652 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 674 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
653 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 675 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
654 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 676 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
655 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 677 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
656 */ | 678 */ |
657 ALmixer_Data* ALmixer_LoadAll(const char* file_name, ALboolean access_data); | 679 ALmixer_Data* ALmixer_LoadAll(const char* file_name, ALuint access_data); |
658 #else | 680 #else |
659 #define ALmixer_LoadAll(file_name, access_data) ALmixer_LoadSample(file_name, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, access_data) | 681 #define ALmixer_LoadAll(file_name, access_data) ALmixer_LoadSample(file_name, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, 0, access_data) |
660 #endif | 682 #endif |
661 | 683 |
662 /** | 684 /** |
663 * This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. | 685 * This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. |
664 * Use at your own risk. | 686 * Use at your own risk. |
671 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 693 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
672 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 694 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
673 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. | 695 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. |
674 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 696 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
675 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 697 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
698 * Buffer underrun conditions will also attempt to restart using this value. | |
699 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
700 * of buffers that will be queued. | |
676 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 701 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
677 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 702 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
678 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 703 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
679 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 704 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
680 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 705 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
681 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 706 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
682 */ | 707 */ |
683 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 708 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
684 | 709 |
685 #ifdef DOXYGEN_ONLY | 710 #ifdef DOXYGEN_ONLY |
686 /** | 711 /** |
687 * This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. | 712 * This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. |
688 * Use at your own risk. | 713 * Use at your own risk. |
693 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with | 718 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with |
694 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 719 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
695 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 720 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
696 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 721 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
697 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 722 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
723 * Buffer underrun conditions will also attempt to restart using this value. | |
724 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
725 * of buffers that will be queued. | |
698 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 726 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
699 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 727 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
700 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 728 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
701 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 729 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
702 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 730 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
703 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 731 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
704 */ | 732 */ |
705 ALmixer_Data* ALmixer_LoadStream_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 733 ALmixer_Data* ALmixer_LoadStream_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
706 #else | 734 #else |
707 #define ALmixer_LoadStream_RAW_RW(rw_ops, file_ext, desired_format, buffer_size, max_queue_buffers, num_startup_buffers, access_data) ALmixer_LoadSample_RAW_RW(rw_ops, file_ext, desired_format, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, access_data) | 735 #define ALmixer_LoadStream_RAW_RW(rw_ops, file_ext, desired_format, buffer_size, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) ALmixer_LoadSample_RAW_RW(rw_ops, file_ext, desired_format, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) |
708 #endif | 736 #endif |
709 | 737 |
710 #ifdef DOXYGEN_ONLY | 738 #ifdef DOXYGEN_ONLY |
711 /** | 739 /** |
712 * This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. | 740 * This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. |
720 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 748 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
721 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 749 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
722 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 750 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
723 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 751 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
724 */ | 752 */ |
725 ALmixer_Data* ALmixer_LoadAll_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALboolean access_data); | 753 ALmixer_Data* ALmixer_LoadAll_RAW_RW(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint access_data); |
726 #else | 754 #else |
727 #define ALmixer_LoadAll_RAW_RW(rw_ops, file_ext, desired_format, access_data) ALmixer_LoadSample_RAW_RW(rw_ops, file_ext, desired_format, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, access_data) | 755 #define ALmixer_LoadAll_RAW_RW(rw_ops, file_ext, desired_format, access_data) ALmixer_LoadSample_RAW_RW(rw_ops, file_ext, desired_format, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, 0, access_data) |
728 #endif | 756 #endif |
729 | 757 |
730 /** | 758 /** |
731 * This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. | 759 * This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. |
732 * Use at your own risk. | 760 * Use at your own risk. |
737 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 765 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
738 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 766 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
739 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. | 767 * @param decode_mode_is_predecoded Specifies whether you want to completely preload the data or stream the data in chunks. |
740 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 768 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
741 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 769 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
770 * Buffer underrun conditions will also attempt to restart using this value. | |
771 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
772 * of buffers that will be queued. | |
742 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 773 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
743 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 774 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
744 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 775 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
745 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 776 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
746 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 777 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
747 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 778 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
748 */ | 779 */ |
749 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 780 extern ALMIXER_DECLSPEC ALmixer_Data * ALMIXER_CALL ALmixer_LoadSample_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
750 | 781 |
751 #ifdef DOXYGEN_ONLY | 782 #ifdef DOXYGEN_ONLY |
752 /** | 783 /** |
753 * This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. | 784 * This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. |
754 * Use at your own risk. | 785 * Use at your own risk. |
757 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with | 788 * @param buffer_size The size of a buffer to allocate for read chunks. This number should be in quantized with |
758 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. | 789 * the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. |
759 * If the file is to be predecoded, optimizations may occur and this value might be ignored. | 790 * If the file is to be predecoded, optimizations may occur and this value might be ignored. |
760 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. | 791 * @param max_queue_buffers For streamed data, specifies the maximum number of buffers that can be queued at any given time. |
761 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. | 792 * @param num_startup_buffers For streamed data, specifies the number of buffers to fill before playback starts. |
793 * Buffer underrun conditions will also attempt to restart using this value. | |
794 * @param suggested_number_of_buffers_to_queue_per_update_pass For each ALmixer_Update() pass, this is the targeted number | |
795 * of buffers that will be queued. | |
762 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed | 796 * @param access_data A boolean that specifies if you want the data contained in the currently playing buffer to be handed |
763 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the | 797 * to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the |
764 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 798 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
765 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 799 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
766 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 800 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
767 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 801 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
768 */ | 802 */ |
769 ALmixer_Data* ALmixer_LoadStream_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALboolean access_data); | 803 ALmixer_Data* ALmixer_LoadStream_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data); |
770 #else | 804 #else |
771 #define ALmixer_LoadStream_RAW(file_name, desired_format, buffer_size, max_queue_buffers, num_startup_buffers, access_data) ALmixer_LoadSample_RAW(file_name, desired_format, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, access_data) | 805 #define ALmixer_LoadStream_RAW(file_name, desired_format, buffer_size, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) ALmixer_LoadSample_RAW(file_name, desired_format, buffer_size, AL_FALSE, max_queue_buffers, num_startup_buffers, suggested_number_of_buffers_to_queue_per_update_pass, access_data) |
772 #endif | 806 #endif |
773 | 807 |
774 #ifdef DOXYGEN_ONLY | 808 #ifdef DOXYGEN_ONLY |
775 /** | 809 /** |
776 * This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. | 810 * This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. |
782 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed | 816 * audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed |
783 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for | 817 * to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for |
784 * using this feature, so if you don't need data callbacks, you should pass false to this function. | 818 * using this feature, so if you don't need data callbacks, you should pass false to this function. |
785 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. | 819 * @return Returns an ALmixer_Data* of the loaded sample or NULL if failed. |
786 */ | 820 */ |
787 ALmixer_Data* ALmixer_LoadAll_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALboolean access_data); | 821 ALmixer_Data* ALmixer_LoadAll_RAW(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint access_data); |
788 #else | 822 #else |
789 #define ALmixer_LoadAll_RAW(file_name, desired_format, access_data) ALmixer_LoadSample_RAW(file_name, desired_format, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, access_data) | 823 #define ALmixer_LoadAll_RAW(file_name, desired_format, access_data) ALmixer_LoadSample_RAW(file_name, desired_format, ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE, AL_TRUE, 0, 0, 0, access_data) |
790 #endif | 824 #endif |
791 | 825 |
792 /** | 826 /** |
793 * Frees an ALmixer_Data. | 827 * Frees an ALmixer_Data. |
794 * Releases the memory associated with a ALmixer_Data. Use this when you are done playing the audio sample | 828 * Releases the memory associated with a ALmixer_Data. Use this when you are done playing the audio sample |