|
CPP-TOOLBOX
|
#include "load_sound_file.hpp"#include <AL/alc.h>#include <AL/alext.h>#include <sndfile.h>#include <cinttypes>#include <climits>#include <cstddef>#include <cstdio>#include <cstdlib>#include <map>#include <stdexcept>#include <string>#include <sstream>#include <iostream>Namespaces | |
| namespace | patch |
Enumerations | |
| enum | FormatType { Int16 , Float , IMA4 , MSADPCM } |
Functions | |
| template<typename T> | |
| std::string | patch::to_string (const T &n) |
| const char * | FormatName (ALenum format) |
| void | open_audio_file (const char *filename, SNDFILE **sound_file, SF_INFO *sound_file_info_ptr) |
| enum FormatType | determine_format_type (SF_INFO sound_file_info) |
| std::tuple< ALint, ALint > | get_byte_and_samples_per_block_alignment (enum FormatType sample_format, const char *filename, SNDFILE *sound_file, SF_INFO sound_file_info) |
| ALenum | determine_openal_format (SNDFILE *sound_file, SF_INFO sound_file_info, enum FormatType sample_format) |
| std::tuple< void *, ALsizei > | decode_audio_file_into_dynamic_memory (const char *filename, SNDFILE *sound_file, SF_INFO sound_file_info, enum FormatType sample_format, ALenum format, ALint byteblockalign, ALint splblockalign) |
| ALuint | load_audio_file_in_dynamic_memory_into_buffer (void *membuf, SNDFILE *sound_file, SF_INFO sound_file_info, ALsizei num_bytes, ALenum format, ALint splblockalign) |
| ALuint | load_sound_and_generate_openal_buffer (const char *filename) |
Variables | |
| std::map< ALenum, const char * > | openal_format_enum_to_string |
| enum FormatType |
| std::tuple< void *, ALsizei > decode_audio_file_into_dynamic_memory | ( | const char * | filename, |
| SNDFILE * | sound_file, | ||
| SF_INFO | sound_file_info, | ||
| enum FormatType | sample_format, | ||
| ALenum | format, | ||
| ALint | byteblockalign, | ||
| ALint | splblockalign ) |
Decode the whole audio file to a buffer
| enum FormatType determine_format_type | ( | SF_INFO | sound_file_info | ) |
| ALenum determine_openal_format | ( | SNDFILE * | sound_file, |
| SF_INFO | sound_file_info, | ||
| enum FormatType | sample_format ) |
| const char * FormatName | ( | ALenum | format | ) |
| std::tuple< ALint, ALint > get_byte_and_samples_per_block_alignment | ( | enum FormatType | sample_format, |
| const char * | filename, | ||
| SNDFILE * | sound_file, | ||
| SF_INFO | sound_file_info ) |
| ALuint load_audio_file_in_dynamic_memory_into_buffer | ( | void * | membuf, |
| SNDFILE * | sound_file, | ||
| SF_INFO | sound_file_info, | ||
| ALsizei | num_bytes, | ||
| ALenum | format, | ||
| ALint | splblockalign ) |
Buffer the audio data into a new buffer object, then free the data and close the file.
| ALuint load_sound_and_generate_openal_buffer | ( | const char * | filename | ) |
| void open_audio_file | ( | const char * | filename, |
| SNDFILE ** | sound_file, | ||
| SF_INFO * | sound_file_info_ptr ) |
| std::map<ALenum, const char *> openal_format_enum_to_string |