Now I know why I get so many megabytes of data.
But I'd ask if I understand everything correctly and I'm doing everything what I should.
There is cool example which I base: ex_stream_file, but I'm not sure that I'm understanding everything right.
So, now I would like to summary what I centrainly do. This is test project, but there I include every step, which I want implement in my game. Only difference that I read music files from one file by al_load_audio_stream_f.
1. When I'm initializing Allegro, I turn on audio streaming. I'm saving a frequency, mixerDepth, voiceDepth and channel conf. I'm creating mixer and voice.
2. In my player I will have pointer on ALLEGRO_AUDIO_STREAM - *musicStream. On begin set on NULL.
3. Now when I want to handle stream:
a) If I want play stream, I call my function playStream:
b) If I want change volume, call this function: al_set_audio_stream_gain(musicStream, 'float value');
c) If I want stop stream, call this function: al_detach_audio_stream(musicStream);
1. How is difference between function above and al_drain_audio_stream? What should I use?
2. I'm not sure what means second and third argument of al_load_audio_stream.
- Second is probably size (on kilobytes?) of stream, which will be loading to play like one piece of stream.
- Third is for information how many streams can play at the same time, through my pointer musicStream? Can I change to 1? At the same time I will playing only one sample. Maybe is nonsense give 2048?
So, this is everything what I should do for correctly handling audio stream in Allegro? Of course, in the end, I'm destroing audio stream, mixer and voice.