![]() |
Wise&mystical
1.0
Project about Europe
|
#include "raylib.h"
#include "config.h"
#include "utils.h"
#include "external/miniaudio.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "external/stb_vorbis.h"
#include "external/jar_xm.h"
#include "external/jar_mod.h"
#include "external/dr_wav.h"
#include "external/dr_mp3.h"
Go to the source code of this file.
Classes | |
struct | rAudioBuffer |
struct | rAudioProcessor |
struct | AudioData |
Macros | |
#define | MA_MALLOC RL_MALLOC |
raudio v1.0 - A simple and easy-to-use audio library based on miniaudio More... | |
#define | MA_FREE RL_FREE |
#define | MA_NO_JACK |
#define | MA_NO_WAV |
#define | MA_NO_FLAC |
#define | MA_NO_MP3 |
#define | MINIAUDIO_IMPLEMENTATION |
#define | STB_VORBIS_IMPLEMENTATION |
#define | JARXM_MALLOC RL_MALLOC |
#define | JARXM_FREE RL_FREE |
#define | JAR_XM_IMPLEMENTATION |
#define | JARMOD_MALLOC RL_MALLOC |
#define | JARMOD_FREE RL_FREE |
#define | JAR_MOD_IMPLEMENTATION |
#define | DRWAV_MALLOC RL_MALLOC |
#define | DRWAV_REALLOC RL_REALLOC |
#define | DRWAV_FREE RL_FREE |
#define | DR_WAV_IMPLEMENTATION |
#define | DRMP3_MALLOC RL_MALLOC |
#define | DRMP3_REALLOC RL_REALLOC |
#define | DRMP3_FREE RL_FREE |
#define | DR_MP3_IMPLEMENTATION |
#define | DEFAULT_AUDIO_BUFFER_SIZE 4096 |
#define | AudioBuffer rAudioBuffer |
#define | TEXT_BYTES_PER_LINE 20 |
Typedefs | |
typedef struct AudioData | AudioData |
Enumerations | |
enum | MusicContextType { MUSIC_AUDIO_NONE = 0 , MUSIC_AUDIO_WAV , MUSIC_AUDIO_OGG , MUSIC_AUDIO_FLAC , MUSIC_AUDIO_MP3 , MUSIC_MODULE_XM , MUSIC_MODULE_MOD } |
enum | AudioBufferUsage { AUDIO_BUFFER_USAGE_STATIC = 0 , AUDIO_BUFFER_USAGE_STREAM } |
Functions | |
AudioBuffer * | LoadAudioBuffer (ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 sizeInFrames, int usage) |
void | UnloadAudioBuffer (AudioBuffer *buffer) |
bool | IsAudioBufferPlaying (AudioBuffer *buffer) |
void | PlayAudioBuffer (AudioBuffer *buffer) |
void | StopAudioBuffer (AudioBuffer *buffer) |
void | PauseAudioBuffer (AudioBuffer *buffer) |
void | ResumeAudioBuffer (AudioBuffer *buffer) |
void | SetAudioBufferVolume (AudioBuffer *buffer, float volume) |
void | SetAudioBufferPitch (AudioBuffer *buffer, float pitch) |
void | SetAudioBufferPan (AudioBuffer *buffer, float pan) |
void | TrackAudioBuffer (AudioBuffer *buffer) |
void | UntrackAudioBuffer (AudioBuffer *buffer) |
void | InitAudioDevice (void) |
void | CloseAudioDevice (void) |
bool | IsAudioDeviceReady (void) |
void | SetMasterVolume (float volume) |
Wave | LoadWave (const char *fileName) |
Wave | LoadWaveFromMemory (const char *fileType, const unsigned char *fileData, int dataSize) |
Sound | LoadSound (const char *fileName) |
Sound | LoadSoundFromWave (Wave wave) |
void | UnloadWave (Wave wave) |
void | UnloadSound (Sound sound) |
void | UpdateSound (Sound sound, const void *data, int sampleCount) |
bool | ExportWave (Wave wave, const char *fileName) |
bool | ExportWaveAsCode (Wave wave, const char *fileName) |
void | PlaySound (Sound sound) |
void | PlaySoundMulti (Sound sound) |
void | StopSoundMulti (void) |
int | GetSoundsPlaying (void) |
void | PauseSound (Sound sound) |
void | ResumeSound (Sound sound) |
void | StopSound (Sound sound) |
bool | IsSoundPlaying (Sound sound) |
void | SetSoundVolume (Sound sound, float volume) |
void | SetSoundPitch (Sound sound, float pitch) |
void | SetSoundPan (Sound sound, float pan) |
void | WaveFormat (Wave *wave, int sampleRate, int sampleSize, int channels) |
Wave | WaveCopy (Wave wave) |
void | WaveCrop (Wave *wave, int initSample, int finalSample) |
float * | LoadWaveSamples (Wave wave) |
void | UnloadWaveSamples (float *samples) |
Music | LoadMusicStream (const char *fileName) |
Music | LoadMusicStreamFromMemory (const char *fileType, const unsigned char *data, int dataSize) |
void | UnloadMusicStream (Music music) |
void | PlayMusicStream (Music music) |
void | PauseMusicStream (Music music) |
void | ResumeMusicStream (Music music) |
void | StopMusicStream (Music music) |
void | SeekMusicStream (Music music, float position) |
void | UpdateMusicStream (Music music) |
bool | IsMusicStreamPlaying (Music music) |
void | SetMusicVolume (Music music, float volume) |
void | SetMusicPitch (Music music, float pitch) |
void | SetMusicPan (Music music, float pan) |
float | GetMusicTimeLength (Music music) |
float | GetMusicTimePlayed (Music music) |
AudioStream | LoadAudioStream (unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) |
void | UnloadAudioStream (AudioStream stream) |
void | UpdateAudioStream (AudioStream stream, const void *data, int frameCount) |
bool | IsAudioStreamProcessed (AudioStream stream) |
void | PlayAudioStream (AudioStream stream) |
void | PauseAudioStream (AudioStream stream) |
void | ResumeAudioStream (AudioStream stream) |
bool | IsAudioStreamPlaying (AudioStream stream) |
void | StopAudioStream (AudioStream stream) |
void | SetAudioStreamVolume (AudioStream stream, float volume) |
void | SetAudioStreamPitch (AudioStream stream, float pitch) |
void | SetAudioStreamPan (AudioStream stream, float pan) |
void | SetAudioStreamBufferSizeDefault (int size) |
void | SetAudioStreamCallback (AudioStream stream, AudioCallback callback) |
void | AttachAudioStreamProcessor (AudioStream stream, AudioCallback process) |
void | DetachAudioStreamProcessor (AudioStream stream, AudioCallback process) |
#define AudioBuffer rAudioBuffer |
#define DRMP3_REALLOC RL_REALLOC |
#define DRWAV_REALLOC RL_REALLOC |
#define MA_MALLOC RL_MALLOC |
raudio v1.0 - A simple and easy-to-use audio library based on miniaudio
FEATURES:
CONFIGURATION:
#define SUPPORT_MODULE_RAUDIO raudio module is included in the build
#define RAUDIO_STANDALONE Define to use the module as standalone library (independently of raylib). Required types and functions are defined in the same module.
#define SUPPORT_FILEFORMAT_WAV #define SUPPORT_FILEFORMAT_OGG #define SUPPORT_FILEFORMAT_XM #define SUPPORT_FILEFORMAT_MOD #define SUPPORT_FILEFORMAT_FLAC #define SUPPORT_FILEFORMAT_MP3 Selected desired fileformats to be supported for loading. Some of those formats are supported by default, to remove support, just comment unrequired #define in this module
DEPENDENCIES: miniaudio.h - Audio device management lib (https://github.com/mackron/miniaudio) stb_vorbis.h - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) dr_wav.h - WAV audio files loading (http://github.com/mackron/dr_libs) dr_mp3.h - MP3 audio file loading (https://github.com/mackron/dr_libs) dr_flac.h - FLAC audio file loading (https://github.com/mackron/dr_libs) jar_xm.h - XM module file loading jar_mod.h - MOD audio file loading
CONTRIBUTORS: David Reid (github: @mackron) (Nov. 2017):
Joshua Reisenauer (github: @kd7tck) (2015)
LICENSE: zlib/libpng
Copyright (c) 2013-2022 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
#define TEXT_BYTES_PER_LINE 20 |
enum AudioBufferUsage |
enum MusicContextType |
void AttachAudioStreamProcessor | ( | AudioStream | stream, |
AudioCallback | process | ||
) |
void CloseAudioDevice | ( | void | ) |
void DetachAudioStreamProcessor | ( | AudioStream | stream, |
AudioCallback | process | ||
) |
float GetMusicTimePlayed | ( | Music | music | ) |
int GetSoundsPlaying | ( | void | ) |
void InitAudioDevice | ( | void | ) |
bool IsAudioBufferPlaying | ( | AudioBuffer * | buffer | ) |
bool IsAudioStreamPlaying | ( | AudioStream | stream | ) |
bool IsAudioStreamProcessed | ( | AudioStream | stream | ) |
AudioBuffer * LoadAudioBuffer | ( | ma_format | format, |
ma_uint32 | channels, | ||
ma_uint32 | sampleRate, | ||
ma_uint32 | sizeInFrames, | ||
int | usage | ||
) |
AudioStream LoadAudioStream | ( | unsigned int | sampleRate, |
unsigned int | sampleSize, | ||
unsigned int | channels | ||
) |
Music LoadMusicStream | ( | const char * | fileName | ) |
Music LoadMusicStreamFromMemory | ( | const char * | fileType, |
const unsigned char * | data, | ||
int | dataSize | ||
) |
Sound LoadSound | ( | const char * | fileName | ) |
Wave LoadWave | ( | const char * | fileName | ) |
Wave LoadWaveFromMemory | ( | const char * | fileType, |
const unsigned char * | fileData, | ||
int | dataSize | ||
) |
void PauseAudioBuffer | ( | AudioBuffer * | buffer | ) |
void PauseAudioStream | ( | AudioStream | stream | ) |
void PauseMusicStream | ( | Music | music | ) |
void PauseSound | ( | Sound | sound | ) |
void PlayAudioBuffer | ( | AudioBuffer * | buffer | ) |
void PlayAudioStream | ( | AudioStream | stream | ) |
void PlayMusicStream | ( | Music | music | ) |
void PlaySound | ( | Sound | sound | ) |
void PlaySoundMulti | ( | Sound | sound | ) |
void ResumeAudioBuffer | ( | AudioBuffer * | buffer | ) |
void ResumeAudioStream | ( | AudioStream | stream | ) |
void ResumeMusicStream | ( | Music | music | ) |
void ResumeSound | ( | Sound | sound | ) |
void SeekMusicStream | ( | Music | music, |
float | position | ||
) |
void SetAudioBufferPan | ( | AudioBuffer * | buffer, |
float | pan | ||
) |
void SetAudioBufferPitch | ( | AudioBuffer * | buffer, |
float | pitch | ||
) |
void SetAudioBufferVolume | ( | AudioBuffer * | buffer, |
float | volume | ||
) |
void SetAudioStreamCallback | ( | AudioStream | stream, |
AudioCallback | callback | ||
) |
void SetAudioStreamPan | ( | AudioStream | stream, |
float | pan | ||
) |
void SetAudioStreamPitch | ( | AudioStream | stream, |
float | pitch | ||
) |
void SetAudioStreamVolume | ( | AudioStream | stream, |
float | volume | ||
) |
void SetMasterVolume | ( | float | volume | ) |
void SetMusicPan | ( | Music | music, |
float | pan | ||
) |
void SetMusicPitch | ( | Music | music, |
float | pitch | ||
) |
void SetMusicVolume | ( | Music | music, |
float | volume | ||
) |
void SetSoundPan | ( | Sound | sound, |
float | pan | ||
) |
void SetSoundPitch | ( | Sound | sound, |
float | pitch | ||
) |
void SetSoundVolume | ( | Sound | sound, |
float | volume | ||
) |
void StopAudioBuffer | ( | AudioBuffer * | buffer | ) |
void StopAudioStream | ( | AudioStream | stream | ) |
void StopMusicStream | ( | Music | music | ) |
void StopSound | ( | Sound | sound | ) |
void StopSoundMulti | ( | void | ) |
void TrackAudioBuffer | ( | AudioBuffer * | buffer | ) |
void UnloadAudioBuffer | ( | AudioBuffer * | buffer | ) |
void UnloadAudioStream | ( | AudioStream | stream | ) |
void UnloadMusicStream | ( | Music | music | ) |
void UnloadSound | ( | Sound | sound | ) |
void UnloadWave | ( | Wave | wave | ) |
void UntrackAudioBuffer | ( | AudioBuffer * | buffer | ) |
void UpdateAudioStream | ( | AudioStream | stream, |
const void * | data, | ||
int | frameCount | ||
) |
void UpdateMusicStream | ( | Music | music | ) |
void UpdateSound | ( | Sound | sound, |
const void * | data, | ||
int | sampleCount | ||
) |
void WaveCrop | ( | Wave * | wave, |
int | initSample, | ||
int | finalSample | ||
) |