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