Wise&mystical  1.0
Project about Europe
Loading...
Searching...
No Matches
raudio.h File Reference

Go to the source code of this file.

Classes

struct  Wave
 
struct  AudioStream
 
struct  Sound
 
struct  Music
 

Macros

#define RL_MALLOC(sz)   malloc(sz)
 raudio v1.0 - A simple and easy-to-use audio library based on miniaudio More...
 
#define RL_CALLOC(n, sz)   calloc(n,sz)
 
#define RL_FREE(p)   free(p)
 
#define _STDBOOL_H
 

Typedefs

typedef struct Wave Wave
 
typedef struct rAudioBuffer rAudioBuffer
 
typedef struct AudioStream AudioStream
 
typedef struct Sound Sound
 
typedef struct Music Music
 

Enumerations

enum  bool {
  false , true , false , true ,
  false , true , false , true
}
 

Functions

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 UpdateSound (Sound sound, const void *data, int samplesCount)
 
void UnloadWave (Wave wave)
 
void UnloadSound (Sound sound)
 
bool ExportWave (Wave wave, const char *fileName)
 
bool ExportWaveAsCode (Wave wave, const char *fileName)
 
void PlaySound (Sound sound)
 
void StopSound (Sound sound)
 
void PauseSound (Sound sound)
 
void ResumeSound (Sound sound)
 
void PlaySoundMulti (Sound sound)
 
void StopSoundMulti (void)
 
int GetSoundsPlaying (void)
 
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, unsigned char *data, int dataSize)
 
void UnloadMusicStream (Music music)
 
void PlayMusicStream (Music music)
 
bool IsMusicStreamPlaying (Music music)
 
void UpdateMusicStream (Music music)
 
void StopMusicStream (Music music)
 
void PauseMusicStream (Music music)
 
void ResumeMusicStream (Music music)
 
void SeekMusicStream (Music music, float position)
 
void SetMusicVolume (Music music, float volume)
 
void SetMusicPan (Music sound, float pan)
 
void SetMusicPitch (Music music, float pitch)
 
float GetMusicTimeLength (Music music)
 
float GetMusicTimePlayed (Music music)
 
AudioStream LoadAudioStream (unsigned int sampleRate, unsigned int sampleSize, unsigned int channels)
 
void UpdateAudioStream (AudioStream stream, const void *data, int samplesCount)
 
void UnloadAudioStream (AudioStream stream)
 
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 strean, float pan)
 
void SetAudioStreamBufferSizeDefault (int size)
 

Macro Definition Documentation

◆ _STDBOOL_H

#define _STDBOOL_H

Definition at line 77 of file raudio.h.

◆ RL_CALLOC

#define RL_CALLOC (   n,
  sz 
)    calloc(n,sz)

Definition at line 64 of file raudio.h.

◆ RL_FREE

#define RL_FREE (   p)    free(p)

Definition at line 67 of file raudio.h.

◆ RL_MALLOC

#define RL_MALLOC (   sz)    malloc(sz)

raudio v1.0 - A simple and easy-to-use audio library based on miniaudio

FEATURES:

  • Manage audio device (init/close)
  • Load and unload audio files
  • Format wave data (sample rate, size, channels)
  • Play/Stop/Pause/Resume loaded audio
  • Manage mixing channels
  • Manage raw audio context

DEPENDENCIES: miniaudio.h - Audio device management lib (https://github.com/dr-soft/miniaudio) stb_vorbis.h - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) 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):

  • Complete port to miniaudio library

Joshua Reisenauer (github: @kd7tck) (2015)

  • XM audio module support (jar_xm)
  • MOD audio module support (jar_mod)
  • Mixing channels support
  • Raw audio context support

LICENSE: zlib/libpng

Copyright (c) 2014-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:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Definition at line 61 of file raudio.h.

Typedef Documentation

◆ AudioStream

typedef struct AudioStream AudioStream

◆ Music

typedef struct Music Music

◆ rAudioBuffer

typedef struct rAudioBuffer rAudioBuffer

Definition at line 90 of file raudio.h.

◆ Sound

typedef struct Sound Sound

◆ Wave

typedef struct Wave Wave

Enumeration Type Documentation

◆ bool

enum bool
Enumerator
false 
true 
false 
true 
false 
true 
false 
true 

Definition at line 76 of file raudio.h.

Function Documentation

◆ CloseAudioDevice()

void CloseAudioDevice ( void  )

Definition at line 494 of file raudio.c.

◆ ExportWave()

bool ExportWave ( Wave  wave,
const char *  fileName 
)

Definition at line 916 of file raudio.c.

◆ ExportWaveAsCode()

bool ExportWaveAsCode ( Wave  wave,
const char *  fileName 
)

Definition at line 958 of file raudio.c.

◆ GetMusicTimeLength()

float GetMusicTimeLength ( Music  music)

Definition at line 1855 of file raudio.c.

◆ GetMusicTimePlayed()

float GetMusicTimePlayed ( Music  music)

Definition at line 1865 of file raudio.c.

◆ GetSoundsPlaying()

int GetSoundsPlaying ( void  )

Definition at line 1098 of file raudio.c.

◆ InitAudioDevice()

void InitAudioDevice ( void  )

Definition at line 421 of file raudio.c.

◆ IsAudioDeviceReady()

bool IsAudioDeviceReady ( void  )

Definition at line 524 of file raudio.c.

◆ IsAudioStreamPlaying()

bool IsAudioStreamPlaying ( AudioStream  stream)

Definition at line 2011 of file raudio.c.

◆ IsAudioStreamProcessed()

bool IsAudioStreamProcessed ( AudioStream  stream)

Definition at line 1985 of file raudio.c.

◆ IsMusicStreamPlaying()

bool IsMusicStreamPlaying ( Music  music)

Definition at line 1831 of file raudio.c.

◆ IsSoundPlaying()

bool IsSoundPlaying ( Sound  sound)

Definition at line 1129 of file raudio.c.

◆ LoadAudioStream()

AudioStream LoadAudioStream ( unsigned int  sampleRate,
unsigned int  sampleSize,
unsigned int  channels 
)

Definition at line 1891 of file raudio.c.

◆ LoadMusicStream()

Music LoadMusicStream ( const char *  fileName)

Definition at line 1254 of file raudio.c.

◆ LoadMusicStreamFromMemory()

Music LoadMusicStreamFromMemory ( const char *  fileType,
unsigned char *  data,
int  dataSize 
)

◆ LoadSound()

Sound LoadSound ( const char *  fileName)

Definition at line 835 of file raudio.c.

◆ LoadSoundFromWave()

Sound LoadSoundFromWave ( Wave  wave)

Definition at line 848 of file raudio.c.

◆ LoadWave()

Wave LoadWave ( const char *  fileName)

Definition at line 726 of file raudio.c.

◆ LoadWaveFromMemory()

Wave LoadWaveFromMemory ( const char *  fileType,
const unsigned char *  fileData,
int  dataSize 
)

Definition at line 744 of file raudio.c.

◆ LoadWaveSamples()

float * LoadWaveSamples ( Wave  wave)

Definition at line 1227 of file raudio.c.

◆ PauseAudioStream()

void PauseAudioStream ( AudioStream  stream)

Definition at line 1999 of file raudio.c.

◆ PauseMusicStream()

void PauseMusicStream ( Music  music)

Definition at line 1658 of file raudio.c.

◆ PauseSound()

void PauseSound ( Sound  sound)

Definition at line 1111 of file raudio.c.

◆ PlayAudioStream()

void PlayAudioStream ( AudioStream  stream)

Definition at line 1993 of file raudio.c.

◆ PlayMusicStream()

void PlayMusicStream ( Music  music)

Definition at line 1643 of file raudio.c.

◆ PlaySound()

void PlaySound ( Sound  sound)

Definition at line 1023 of file raudio.c.

◆ PlaySoundMulti()

void PlaySoundMulti ( Sound  sound)

Definition at line 1029 of file raudio.c.

◆ ResumeAudioStream()

void ResumeAudioStream ( AudioStream  stream)

Definition at line 2005 of file raudio.c.

◆ ResumeMusicStream()

void ResumeMusicStream ( Music  music)

Definition at line 1664 of file raudio.c.

◆ ResumeSound()

void ResumeSound ( Sound  sound)

Definition at line 1117 of file raudio.c.

◆ SeekMusicStream()

void SeekMusicStream ( Music  music,
float  position 
)

Definition at line 1699 of file raudio.c.

◆ SetAudioStreamBufferSizeDefault()

void SetAudioStreamBufferSizeDefault ( int  size)

Definition at line 2041 of file raudio.c.

◆ SetAudioStreamPan()

void SetAudioStreamPan ( AudioStream  strean,
float  pan 
)

Definition at line 2035 of file raudio.c.

◆ SetAudioStreamPitch()

void SetAudioStreamPitch ( AudioStream  stream,
float  pitch 
)

Definition at line 2029 of file raudio.c.

◆ SetAudioStreamVolume()

void SetAudioStreamVolume ( AudioStream  stream,
float  volume 
)

Definition at line 2023 of file raudio.c.

◆ SetMasterVolume()

void SetMasterVolume ( float  volume)

Definition at line 530 of file raudio.c.

◆ SetMusicPan()

void SetMusicPan ( Music  sound,
float  pan 
)

Definition at line 1849 of file raudio.c.

◆ SetMusicPitch()

void SetMusicPitch ( Music  music,
float  pitch 
)

Definition at line 1843 of file raudio.c.

◆ SetMusicVolume()

void SetMusicVolume ( Music  music,
float  volume 
)

Definition at line 1837 of file raudio.c.

◆ SetSoundPan()

void SetSoundPan ( Sound  sound,
float  pan 
)

Definition at line 1147 of file raudio.c.

◆ SetSoundPitch()

void SetSoundPitch ( Sound  sound,
float  pitch 
)

Definition at line 1141 of file raudio.c.

◆ SetSoundVolume()

void SetSoundVolume ( Sound  sound,
float  volume 
)

Definition at line 1135 of file raudio.c.

◆ StopAudioStream()

void StopAudioStream ( AudioStream  stream)

Definition at line 2017 of file raudio.c.

◆ StopMusicStream()

void StopMusicStream ( Music  music)

Definition at line 1670 of file raudio.c.

◆ StopSound()

void StopSound ( Sound  sound)

Definition at line 1123 of file raudio.c.

◆ StopSoundMulti()

void StopSoundMulti ( void  )

Definition at line 1092 of file raudio.c.

◆ UnloadAudioStream()

void UnloadAudioStream ( AudioStream  stream)

Definition at line 1923 of file raudio.c.

◆ UnloadMusicStream()

void UnloadMusicStream ( Music  music)

Definition at line 1614 of file raudio.c.

◆ UnloadSound()

void UnloadSound ( Sound  sound)

Definition at line 897 of file raudio.c.

◆ UnloadWave()

void UnloadWave ( Wave  wave)

Definition at line 890 of file raudio.c.

◆ UnloadWaveSamples()

void UnloadWaveSamples ( float *  samples)

Definition at line 1244 of file raudio.c.

◆ UpdateAudioStream()

void UpdateAudioStream ( AudioStream  stream,
const void *  data,
int  samplesCount 
)

Definition at line 1933 of file raudio.c.

◆ UpdateMusicStream()

void UpdateMusicStream ( Music  music)

Definition at line 1727 of file raudio.c.

◆ UpdateSound()

void UpdateSound ( Sound  sound,
const void *  data,
int  samplesCount 
)

Definition at line 904 of file raudio.c.

◆ WaveCopy()

Wave WaveCopy ( Wave  wave)

Definition at line 1185 of file raudio.c.

◆ WaveCrop()

void WaveCrop ( Wave wave,
int  initSample,
int  finalSample 
)

Definition at line 1207 of file raudio.c.

◆ WaveFormat()

void WaveFormat ( Wave wave,
int  sampleRate,
int  sampleSize,
int  channels 
)

Definition at line 1153 of file raudio.c.