Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 2.37 KB

music_ogg.h

File metadata and controls

76 lines (59 loc) · 2.37 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
22
23
24
25
*/
#ifdef OGG_MUSIC
/* This file supports Ogg Vorbis music streams */
Oct 28, 2018
Oct 28, 2018
26
27
28
#ifndef OV_EXCLUDE_STATIC_CALLBACKS
#define OV_EXCLUDE_STATIC_CALLBACKS
#endif
Jul 15, 2007
Jul 15, 2007
29
30
31
#ifdef OGG_USE_TREMOR
#include <tremor/ivorbisfile.h>
#else
32
#include <vorbis/vorbisfile.h>
Jul 15, 2007
Jul 15, 2007
33
#endif
34
35
typedef struct {
Dec 31, 2011
Dec 31, 2011
36
37
SDL_RWops *rw;
int freerw;
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
55
/* Load an OGG stream from an SDL_RWops object */
Dec 31, 2011
Dec 31, 2011
56
extern OGG_music *OGG_new_RW(SDL_RWops *rw, int freerw);
Aug 22, 2004
Aug 22, 2004
57
58
59
60
61
62
63
64
/* 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
65
extern int OGG_playAudio(OGG_music *music, Uint8 *stream, int len);
66
67
68
69
70
71
72
/* 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
73
74
75
/* Jump (seek) to a given position (time is in seconds) */
extern void OGG_jump_to_time(OGG_music *music, double time);
76
#endif /* OGG_MUSIC */