summaryrefslogtreecommitdiffhomepage
path: root/cheatsheet/raylib_audio.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-04-12 12:25:44 +0200
committerRay <[email protected]>2019-04-12 12:25:44 +0200
commitbf95bc1162e070d1b74940f353fa5bd444543871 (patch)
treef733e13041161c552794fdd82de6c37d1456afb9 /cheatsheet/raylib_audio.c
parenta3b4e55e88fe1650c9daf3753ceace0292e8a66c (diff)
downloadraylib.com-bf95bc1162e070d1b74940f353fa5bd444543871.tar.gz
raylib.com-bf95bc1162e070d1b74940f353fa5bd444543871.zip
Update cheatsheet to raylib v2.5
Diffstat (limited to 'cheatsheet/raylib_audio.c')
-rw-r--r--cheatsheet/raylib_audio.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/cheatsheet/raylib_audio.c b/cheatsheet/raylib_audio.c
index 3d0447b..6341cde 100644
--- a/cheatsheet/raylib_audio.c
+++ b/cheatsheet/raylib_audio.c
@@ -5,16 +5,23 @@
bool IsAudioDeviceReady(void); // Check if audio device is ready
void SetMasterVolume(float volume); // Set master volume (listener)
+ // Audio device management functions
+ void InitAudioDevice(void); // Initialize audio device and context
+ void CloseAudioDevice(void); // Close the audio device and context
+ bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
+ void SetMasterVolume(float volume); // Set master volume (listener)
+
// Wave/Sound loading/unloading functions
- Wave LoadWave(const char *fileName); // Load wave data from file into RAM
- Wave LoadWaveEx(float *data, int sampleCount, int sampleRate,
- int sampleSize, int channels); // Load wave data from float array data (32bit)
- Sound LoadSound(const char *fileName); // Load sound to memory
- Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data
- void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data
+ Wave LoadWave(const char *fileName); // Load wave data from file
+ Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data
+ Sound LoadSound(const char *fileName); // Load sound from file
+ Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
+ void UpdateSound(Sound sound, const void *data, int samplesCount); // Update sound buffer with new data
void UnloadWave(Wave wave); // Unload wave data
void UnloadSound(Sound sound); // Unload sound
-
+ void ExportWave(Wave wave, const char *fileName); // Export wave data to file
+ void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h)
+
// Wave/Sound management functions
void PlaySound(Sound sound); // Play a sound
void PauseSound(Sound sound); // Pause a sound
@@ -27,7 +34,7 @@
Wave WaveCopy(Wave wave); // Copy a wave to a new wave
void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
float *GetWaveData(Wave wave); // Get samples data from wave as a floats array
-
+
// Music management functions
Music LoadMusicStream(const char *fileName); // Load music stream from file
void UnloadMusicStream(Music music); // Unload music stream
@@ -39,18 +46,20 @@
bool IsMusicPlaying(Music music); // Check if music is playing
void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
- void SetMusicLoopCount(Music music, float count); // Set music loop count (loop repeats)
+ void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats)
float GetMusicTimeLength(Music music); // Get music time length (in seconds)
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
// AudioStream management functions
- AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize,
- unsigned int channels); // Init audio stream (to stream raw audio pcm data)
- void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data
+ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data)
+ void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data
void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
void PlayAudioStream(AudioStream stream); // Play audio stream
void PauseAudioStream(AudioStream stream); // Pause audio stream
void ResumeAudioStream(AudioStream stream); // Resume audio stream
+ bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing
void StopAudioStream(AudioStream stream); // Stop audio stream
+ void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
+ void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)