X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=inline;f=sound.h;h=684102eece285082e775d662d857da8e09af6d3e;hb=c59fd00b98a29e44bb5951d791f913d0aba1f0fa;hp=89e56a932cd3108652b7d8d4831253fefb7cacf2;hpb=b47b74389ee3f609d12f738f6038842fbd0d409a;p=xonotic%2Fdarkplaces.git diff --git a/sound.h b/sound.h index 89e56a93..684102ee 100644 --- a/sound.h +++ b/sound.h @@ -38,7 +38,7 @@ typedef struct int speed; int width; int stereo; - byte data[1]; // variable sized + qbyte data[1]; // variable sized } sfxcache_t; typedef struct sfx_s @@ -90,6 +90,8 @@ typedef struct void S_Init (void); void S_Startup (void); void S_Shutdown (void); +void S_Open (void); +void S_Close (void); void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void S_StopSound (int entnum, int entchannel); @@ -98,7 +100,7 @@ void S_ClearBuffer (void); void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void S_ExtraUpdate (void); -sfx_t *S_PrecacheSound (char *sample); +sfx_t *S_PrecacheSound (char *sample, int complain); void S_TouchSound (char *sample); void S_ClearPrecache (void); void S_BeginPrecaching (void); @@ -167,9 +169,9 @@ extern qboolean snd_initialized; extern int snd_blocked; void S_LocalSound (char *s); -sfxcache_t *S_LoadSound (sfx_t *s); +sfxcache_t *S_LoadSound (sfx_t *s, int complain); -wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength); +wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength); void SND_InitScaletable (void); void SNDDMA_Submit(void); @@ -177,4 +179,23 @@ void SNDDMA_Submit(void); void S_AmbientOff (void); void S_AmbientOn (void); +void *S_LockBuffer(void); +void S_UnlockBuffer(void); + +// add some data to the tail of the rawsamples queue +void S_RawSamples_Enqueue(short *samples, unsigned int length); +// read and remove some data from the head of the rawsamples queue +void S_RawSamples_Dequeue(int *samples, unsigned int length); +// empty the rawsamples queue +void S_RawSamples_ClearQueue(void); +// returns how much more data the queue wants, or 0 if it is already full enough +int S_RawSamples_QueueWantsMore(void); + +// resamples one sound buffer into another, while changing the length +void S_ResampleBuffer16Stereo(short *input, int inputlength, short *output, int outputlength); + +// returns the rate that the rawsamples system is running at +int S_RawSamples_SampleRate(void); + #endif +