Documentation de la bibliothèque MLV-3.1.0

MLV_audio.h
Aller à la documentation de ce fichier.
1/*
2 * This file is part of the MLV Library.
3 *
4 * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5 *
6 *
7 * This Library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This Library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
32#ifndef __MLV__MLV_AUDIO_H__
33#define __MLV__MLV_AUDIO_H__
34
35#ifndef MEMORY_DEBUG
36#include <SDL/SDL.h>
37#else
38#include "memory_debug.h"
39#endif
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
48typedef struct _MLV_Music MLV_Music;
49
53typedef struct _MLV_Sound MLV_Sound;
54
63
68
96int MLV_change_audio_buffer_size( int buffer_size );
97
105
120MLV_Music* MLV_load_music( const char* file_music );
121
128
137void MLV_play_music( const MLV_Music* music, float volume, int loop );
138
143
144
160MLV_Sound* MLV_load_sound( const char* file_sound );
161
168
175void MLV_play_sound( const MLV_Sound* sound, float volume );
176
181
182
183#ifdef __cplusplus
184}
185#endif
186
187#endif
MLV_Music * MLV_load_music(const char *file_music)
Charge un ficher contenant de la musique en mémoire.
MLV_Sound * MLV_load_sound(const char *file_sound)
Charge un ficher contenant un échantillon sonore en mémoire.
void MLV_play_sound(const MLV_Sound *sound, float volume)
Joue un échantillon sonore chargé en mémoire.
void MLV_change_number_of_parallel_sounds(unsigned int n)
Change le nombre d'écahantillons sonores qui peuvent être joués en même temps.
int MLV_init_audio()
Cette fonction initialise la bibliothèque MLV pour pouvoir jouer de la musique et des sons.
void MLV_free_music(MLV_Music *music)
Ferme un morceau de musique chargé en mémoire.
int MLV_change_audio_buffer_size(int buffer_size)
Change la taille du buffer audio. La taille doit être une puissance de 2.
void MLV_play_music(const MLV_Music *music, float volume, int loop)
Joue un morceau de musique qui est chargée en mémoire.
void MLV_free_sound(MLV_Sound *sound)
Ferme un échantillon sonore chargé en mémoire.
struct _MLV_Sound MLV_Sound
Ce type code un échantillon sonore.
Definition MLV_audio.h:53
void MLV_stop_all_sounds()
Arrête tous les échantillons sonores.
void MLV_stop_music()
Arrête toutes les musiques.
void MLV_free_audio()
Ferme proprement les différents périphériques audios.
struct _MLV_Music MLV_Music
Ce type code un morceau de musique.
Definition MLV_audio.h:48