wavestream.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 14 Dec 2001 12:56:55 +0000
changeset 138 4d0dc6b4985d
parent 64 00b28153c609
child 140 efa15d2a5403
permissions -rw-r--r--
Updated the copyright information
slouken@0
     1
/*
slouken@138
     2
    SDL_mixer:  An audio mixer library based on the SDL library
slouken@138
     3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@0
     6
    modify it under the terms of the GNU Library General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@0
     8
    version 2 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@0
    13
    Library General Public License for more details.
slouken@0
    14
slouken@0
    15
    You should have received a copy of the GNU Library General Public
slouken@0
    16
    License along with this library; if not, write to the Free
slouken@0
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@138
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@138
    23
/* $id:$ */
slouken@138
    24
slouken@0
    25
/* This file supports streaming WAV files, without volume adjustment */
slouken@0
    26
slouken@0
    27
#include <stdio.h>
slouken@0
    28
slouken@0
    29
typedef struct {
slouken@0
    30
	FILE *wavefp;
slouken@0
    31
	long  start;
slouken@0
    32
	long  stop;
slouken@0
    33
	SDL_AudioCVT cvt;
slouken@0
    34
} WAVStream;
slouken@0
    35
slouken@0
    36
/* Initialize the WAVStream player, with the given mixer settings
slouken@0
    37
   This function returns 0, or -1 if there was an error.
slouken@0
    38
 */
slouken@0
    39
extern int WAVStream_Init(SDL_AudioSpec *mixer);
slouken@0
    40
slouken@0
    41
/* Unimplemented */
slouken@0
    42
extern void WAVStream_SetVolume(int volume);
slouken@0
    43
slouken@0
    44
/* Load a WAV stream from the given file */
slouken@0
    45
extern WAVStream *WAVStream_LoadSong(const char *file, const char *magic);
slouken@0
    46
slouken@0
    47
/* Start playback of a given WAV stream */
slouken@0
    48
extern void WAVStream_Start(WAVStream *wave);
slouken@0
    49
slouken@0
    50
/* Play some of a stream previously started with WAVStream_Start() */
slouken@64
    51
extern void WAVStream_PlaySome(Uint8 *stream, int len);
slouken@0
    52
slouken@0
    53
/* Stop playback of a stream previously started with WAVStream_Start() */
slouken@0
    54
extern void WAVStream_Stop(void);
slouken@0
    55
slouken@0
    56
/* Close the given WAV stream */
slouken@0
    57
extern void WAVStream_FreeSong(WAVStream *wave);
slouken@0
    58
slouken@0
    59
/* Return non-zero if a stream is currently playing */
slouken@64
    60
extern int WAVStream_Active(void);