Hey everyone, I'm working on some easy games and came to the point i wanted to add music to the game, i made 2 functions, one for sound effects using (.wav)
and one for songs, the problem is when i loaded songs in al_load_sample, it used way to much memory so i searched for another way and found al_load_audio_stream, which works but it sounds horrible, now i think this has to do with the loading part since i'm not sure if i did that right, and i'm looking for some advice to load it and make it sound better.
Here's the code i'm using now:
Thanks for the support so far!
Julian.
Define sounds horrible. Is it breaking up because I would recommend at least two 4k buffers.
yeah, with "sounds weird" i mean a bit breaking up, i tried to make it sound better but this was the best i could get it. now my question would be how many buffers and how many samples should i need to load the song.
So you have tried: song = al_load_audio_stream(sfx, 2, 1024 * 4);
exactly like Trent suggested?
Do other programs stream audio normally?
yes, i've tried that and it sounds actually exactly the same, for other programs, i've never tested that.
Does non-streaming sounds also break? (In which case the disk buffer used in streaming wouldn't be the cause.)
non-streaming sounds are working fine.
Does it also sound broken when you play the audio file with ex_stream_file?
It's fixed now, i forgot the event, stupid of me. but thanks for the support .