Update C sources and examples
This commit is contained in:
parent
3b28d17b95
commit
8f1ad11c49
100 changed files with 2081 additions and 1686 deletions
|
@ -1,31 +1,37 @@
|
|||
/**********************************************************************************************
|
||||
*
|
||||
* raylib.audio
|
||||
* raylib.audio - Basic funtionality to work with audio
|
||||
*
|
||||
* This module provides basic functionality to work with audio:
|
||||
* Manage audio device (init/close)
|
||||
* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD)
|
||||
* Play/Stop/Pause/Resume loaded audio
|
||||
* Manage mixing channels
|
||||
* Manage raw audio context
|
||||
* 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
|
||||
*
|
||||
* LIMITATIONS:
|
||||
* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS)
|
||||
* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32)
|
||||
*
|
||||
* DEPENDENCIES:
|
||||
* OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html)
|
||||
* stb_vorbis - OGG audio files loading (http://www.nothings.org/stb_vorbis/)
|
||||
* jar_xm - XM module file loading
|
||||
* jar_mod - MOD audio file loading
|
||||
* dr_flac - FLAC audio file loading
|
||||
* jar_xm - XM module file loading (#define SUPPORT_FILEFORMAT_XM)
|
||||
* jar_mod - MOD audio file loading (#define SUPPORT_FILEFORMAT_MOD)
|
||||
* dr_flac - FLAC audio file loading (#define SUPPORT_FILEFORMAT_FLAC)
|
||||
*
|
||||
* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions:
|
||||
* XM audio module support (jar_xm)
|
||||
* MOD audio module support (jar_mod)
|
||||
* Mixing channels support
|
||||
* Raw audio context support
|
||||
* CONTRIBUTORS:
|
||||
* Joshua Reisenauer (github: @kd7tck):
|
||||
* - 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-2016 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2014-2017 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.
|
||||
|
@ -117,7 +123,7 @@ Wave LoadWave(const char *fileName); // Load wave dat
|
|||
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 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 PlaySound(Sound sound); // Play a sound
|
||||
|
@ -145,10 +151,11 @@ void SetMusicLoopCount(Music music, float count); // Set music loo
|
|||
float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||
|
||||
// Raw audio stream 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 samplesCount); // Update audio stream buffers with data
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue