Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 2.3 KB

music_ogg.h

File metadata and controls

75 lines (57 loc) · 2.3 KB
 
Dec 31, 2011
Dec 31, 2011
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SDL_mixer: An audio mixer library based on the SDL library
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
20
21
*/
Dec 14, 2001
Dec 14, 2001
22
/* $Id$ */
Dec 14, 2001
Dec 14, 2001
23
24
25
26
27
#ifdef OGG_MUSIC
/* This file supports Ogg Vorbis music streams */
Jul 15, 2007
Jul 15, 2007
28
29
30
#ifdef OGG_USE_TREMOR
#include <tremor/ivorbisfile.h>
#else
31
#include <vorbis/vorbisfile.h>
Jul 15, 2007
Jul 15, 2007
32
#endif
33
34
typedef struct {
Dec 31, 2011
Dec 31, 2011
35
36
SDL_RWops *rw;
int freerw;
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
int playing;
int volume;
OggVorbis_File vf;
int section;
SDL_AudioCVT cvt;
int len_available;
Uint8 *snd_available;
} OGG_music;
/* Initialize the Ogg Vorbis player, with the given mixer settings
This function returns 0, or -1 if there was an error.
*/
extern int OGG_init(SDL_AudioSpec *mixer);
/* Set the volume for an OGG stream */
extern void OGG_setvolume(OGG_music *music, int volume);
Aug 22, 2004
Aug 22, 2004
54
/* Load an OGG stream from an SDL_RWops object */
Dec 31, 2011
Dec 31, 2011
55
extern OGG_music *OGG_new_RW(SDL_RWops *rw, int freerw);
Aug 22, 2004
Aug 22, 2004
56
57
58
59
60
61
62
63
/* Start playback of a given OGG stream */
extern void OGG_play(OGG_music *music);
/* Return non-zero if a stream is currently playing */
extern int OGG_playing(OGG_music *music);
/* Play some of a stream previously started with OGG_play() */
Nov 19, 2005
Nov 19, 2005
64
extern int OGG_playAudio(OGG_music *music, Uint8 *stream, int len);
65
66
67
68
69
70
71
/* Stop playback of a stream previously started with OGG_play() */
extern void OGG_stop(OGG_music *music);
/* Close the given OGG stream */
extern void OGG_delete(OGG_music *music);
Dec 20, 2001
Dec 20, 2001
72
73
74
/* Jump (seek) to a given position (time is in seconds) */
extern void OGG_jump_to_time(OGG_music *music, double time);
75
#endif /* OGG_MUSIC */