Commit graph

256 commits

Author SHA1 Message Date
raysan5
5663c81803 REVIEWED: raudio: Some LOG_ERROR -> LOG_WARNING #1562 2021-02-05 19:19:44 +01:00
raysan5
ed9c10a3e6 Update raudio.c 2021-02-02 11:42:49 +01:00
Ray
b7f275efb3 Review warning 2021-01-15 00:20:23 +01:00
raysan5
d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
Victor Gallet
9fe153ae29
Avoid dereferencing a null pointer in the 'LoadSounsFromWave' function if the audioBuffer is null (#1499) 2020-12-31 13:28:16 +01:00
raysan5
0a9e080998 Remove trailing spaces 2020-12-23 15:03:26 +01:00
Ray
e07bc372a1 WARNING: RENAMED several functions for consistency #1440
This is a BREAKING CHANGE!

To address the linked issue, several functions have been renamed and couterpart functions have been created to free loaded memory:
 - RENAMED: GetImageData() -> LoadImageColors()
 - RENAMED: GetImagePalette() -> LoadImagePalette()
 - RENAMED: GetWaveData() -> LoadWaveSamples()
 - ADDED: UnloadImageColors()
 - ADDED: UnloadImagePalette()
 - ADDED: UnloadWaveSamples()
2020-12-18 21:03:08 +01:00
Ray
e6ae4879f6 Added security check to pitch change #1450 2020-12-12 13:07:46 +01:00
Ray
459c4754dc Reviewed SetAudioBufferPitch() #1450 2020-12-12 13:01:31 +01:00
Jeffery Myers
df249f5513
Fix typecast warnings in raylib code as reported by visual studio 2019 (#1443) 2020-11-30 08:14:11 +01:00
Ray
bb9d734f69 Exposing some file access results to user layer #1420 2020-11-22 00:10:16 +01:00
Ray
7f6cd93d62 WARNING: Multiple funcs reviewed!
There were some problems about frameCount vs sampleCount that could cause some breaks.

raylib audio structs stores sampleCount = frameCount*channels.

Most libraries return framesCount instead of sampleCount.

stb_vorbis seems to refer to framesCount as samples.

All required functions have been reviewed.
2020-11-19 20:11:11 +01:00
Ray
f448542dd2 Review issues with FLAC loading 2020-11-16 12:20:50 +01:00
raysan5
321f55bce1 Update audio libraries #1423
miniaudio -> v0.10.25
dr_wav -> v0.12.14
dr_mp3 -> v0.6.19
dr_flac -> v0.12.22
2020-11-15 14:04:28 +01:00
Ray
3e1cd487df Remove trailing spaces 2020-11-03 23:47:33 +01:00
raysan5
43d82c1f21 Add security checks when loading data from memory 2020-09-16 11:33:56 +02:00
raysan5
2d96196d25 REVIEWED: SaveWAV() to use memory write insted of file 2020-09-15 13:17:10 +02:00
Ray
8cf0be4b6c Review memory loading functions signesness 2020-09-14 19:20:38 +02:00
Ray
5b60a743bd ADDED: LoadWaveFromMemory() #1327 2020-09-13 15:38:57 +02:00
raysan5
ad1b3330b7 Support mulstiple WAV sampleSize for MusicStream #1340
24bit per sample is not supported internally and automatically converted 16bit
2020-08-11 19:08:07 +02:00
raysan5
6e9e7bd6bc LoadSound(): Use memory loading (WAV, OGG, MP3, FLAC) #1312 2020-07-31 12:13:04 +02:00
raysan5
bf429a0058 Remove conditional __EMSCRIPTEN__
Not required anymore
2020-07-13 18:57:46 +02:00
raysan5
fa7799143e Update miniaudio to v0.10.12, solves #1288 2020-07-10 13:29:42 +02:00
Random
86a8f1d5d5
Chromium needs a larger audio buffer (#1300)
* Chromium needs a larger audio buffer: https://github.com/dr-soft/miniaudio/issues/150

* changed PLATFORM_WEB to __EMSCRIPTEN__
2020-07-10 12:34:35 +02:00
Ray
5986eee6ab Expose additional configuration options
Some internal defines have been exposed in config.h
2020-06-30 11:05:09 +02:00
raysan5
1c5df677e1 REDESIGNED: ExportWaveAsCode() to use memory buffer 2020-05-24 15:48:07 +02:00
raysan5
8120547639 Added LoadWAV()/SaveWAV() memory buffer sample code
It could be useful in a future...
2020-05-24 00:20:32 +02:00
raysan5
a6fcd32339 Support WAV music streaming #1198
Switched custom WAV laoding/saving funtionality to drwav library, it also provides the required mechanisms to stream wav data.
2020-05-23 23:19:59 +02:00
raysan5
94789dd24a Review usage of sizeof(), unify conventions
All functions requiring sizeof() now follow the same convention:

NUM_ELEMENTS*NUM_SUBELEMENTS*sizeof()
2020-05-23 19:23:40 +02:00
raysan5
a2955bc5b3 Corrected issue with multichannel on CloseAudioDevice() 2020-05-22 00:32:23 +02:00
raysan5
257f232d41 WARNING: BREAKING CHANGE: Review audio looping system
Current looping system was broken, `loopCount` has been converted to `bool looping` and user can enable/disable with `music.looping = false`. `SetMusicLoopCount()` has been removed.
2020-05-14 14:00:37 +02:00
raysan5
fdad1f023b Avoid all MSVC compile warnings
Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
2020-05-06 19:12:09 +02:00
raysan5
51c3bef497 Review exposed #defines and allow user re-defining
There are multiple #define values around raylib, usually not exposed for redefinition, just reviewed all of them to allow users redefining them on compile time if required.

Also, multiple #define have been renamed and commented.
2020-05-01 17:31:44 +02:00
Louis Johnson
4f40f8bc47
added log warning for unsupported file extension for music stream (#1176)
* added log warning for unsupported file extension for music stream

* updated error log message for music stream when file format isn't supported
2020-04-06 11:26:09 +02:00
Dani Martin
1a948849f3
[cppcheck] Fix minor warnings in models.c and raudio.c (#1162)
Errores fixes:
models.c,2843 Either the condition 'fileData!=NULL' is redundant or there is possible null pointer dereference: fileData.
raudio.c,805, 806, 807, 808, %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
2020-03-30 17:08:01 +02:00
raysan5
d28e73849b Review TRACELOG() messages 2020-03-27 18:49:21 +01:00
raysan5
915b5f370b [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:43:24 +01:00
raysan5
0c6c421508 [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:16:30 +01:00
raysan5
7ae7a87f8a Remove trail spaces 2020-03-25 19:41:51 +01:00
raysan5
2344941974 Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
2020-03-17 13:40:07 +01:00
Ray
05992a6fce Tweaks 2020-02-27 16:37:32 +01:00
Ray
ac73e3b5e2 REDESIGN: ExportWave()
Use new file I/O ABI
2020-02-27 16:15:20 +01:00
Ray
5ff0776235 Remove trail spaces and some tweaks 2020-02-27 13:33:09 +01:00
Ray
0f783aab34 Remove TraceLog() dependency on standalone mode 2020-02-26 20:23:36 +01:00
Ray
51db3b589d Review function name on RAUDIO_STANDALONE 2020-02-18 18:14:22 +01:00
Ray
3f25c52a29 Some security checks in case music is not properly loaded 2020-02-18 16:30:52 +01:00
Ray
91b2dc2aa9 [raudio] ADDED: SetAudioStreamBufferSizeDefault()
There could be some cases where we need to define the internal audio buffer size, now it's possible.

RENAMED: InitAudioBuffer() to LoadAudioBuffer()
RENAMED: CloseAudioBuffer() to UnloadAudioBuffer()

Renamed some defines and reviewed some comments.
2020-02-14 17:13:37 +01:00
Ray
7459a5c6ef Remove "No Audio Buffer" traces 2020-02-14 11:44:50 +01:00
Ray
3b3e163c48 [raudio] Corrected issue with OGG sound loading 2020-02-13 11:41:28 +01:00
Ray
1b20182d33 Updated periodSize reference 2020-02-12 14:45:02 +01:00