Added function to create new sound from raw buffer
This commit is contained in:
@@ -134,6 +134,13 @@ void JA_DeleteMusic(JA_Music music) {
|
|||||||
delete music;
|
delete music;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JA_Sound JA_NewSound(Uint8* buffer, Uint32 length) {
|
||||||
|
JA_Sound sound = new JA_Sound_t();
|
||||||
|
sound->buffer = buffer;
|
||||||
|
sound->length = length;
|
||||||
|
return sound;
|
||||||
|
}
|
||||||
|
|
||||||
JA_Sound JA_LoadSound(const char* filename) {
|
JA_Sound JA_LoadSound(const char* filename) {
|
||||||
JA_Sound sound = new JA_Sound_t();
|
JA_Sound sound = new JA_Sound_t();
|
||||||
SDL_AudioSpec wavSpec;
|
SDL_AudioSpec wavSpec;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ void JA_StopMusic();
|
|||||||
JA_Music_state JA_GetMusicState();
|
JA_Music_state JA_GetMusicState();
|
||||||
void JA_DeleteMusic(JA_Music music);
|
void JA_DeleteMusic(JA_Music music);
|
||||||
|
|
||||||
|
JA_Sound JA_NewSound(Uint8* buffer, Uint32 length);
|
||||||
JA_Sound JA_LoadSound(const char* filename);
|
JA_Sound JA_LoadSound(const char* filename);
|
||||||
int JA_PlaySound(JA_Sound sound, const int loop = 0);
|
int JA_PlaySound(JA_Sound sound, const int loop = 0);
|
||||||
void JA_PauseChannel(const int channel);
|
void JA_PauseChannel(const int channel);
|
||||||
|
|||||||
Reference in New Issue
Block a user