Continue crash sound
This commit is contained in:
parent
b90f5bbfc8
commit
85b8b1352d
3 changed files with 65 additions and 64 deletions
|
@ -16,23 +16,14 @@ FILE *musicFile = 0;
|
|||
|
||||
void audioFillCallback(void *userdata, uint8_t *s, int l)
|
||||
{
|
||||
for (int i = 0; i < l; ++i)
|
||||
if (musicFile)
|
||||
{
|
||||
unsigned char byte = 128;
|
||||
|
||||
if (musicFile)
|
||||
{
|
||||
if (!fread(&byte,1,1,musicFile))
|
||||
rewind(musicFile);
|
||||
}
|
||||
|
||||
// s[i] = byte;
|
||||
|
||||
s[i] = byte / 2 + LCR_gameGetNextAudioSample() / 2;
|
||||
//s[i] = LCR_gameGetNextAudioSample();
|
||||
|
||||
|
||||
if (!fread(s,1,l,musicFile))
|
||||
rewind(musicFile);
|
||||
}
|
||||
|
||||
for (int i = 0; i < l; ++i)
|
||||
s[i] = s[i] / 2 + LCR_gameGetNextAudioSample() / 2;
|
||||
}
|
||||
|
||||
const uint8_t *keyboardState;
|
||||
|
@ -97,7 +88,7 @@ int main(int argc, char *argv[])
|
|||
audioSpec.freq = 8000;
|
||||
audioSpec.format = AUDIO_U8;
|
||||
audioSpec.channels = 1;
|
||||
audioSpec.samples = 256;
|
||||
audioSpec.samples = 64;
|
||||
|
||||
if (SDL_OpenAudio(&audioSpec,NULL) < 0)
|
||||
fputs("could not initialize audio",stderr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue