Skip to content

Commit

Permalink
Merge branch 'openal' of https://github.com/rheit/zdoom into osx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Mar 28, 2015
2 parents d0f6883 + 98b2475 commit 10083e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/s_sound.cpp
Expand Up @@ -1318,23 +1318,23 @@ sfxinfo_t *S_LoadSound(sfxinfo_t *sfx)
SDWORD dmxlen = LittleLong(((SDWORD *)sfxdata)[1]);

// If the sound is voc, use the custom loader.
// If the sound is raw, just load it as such.
// Otherwise, try the sound as DMX format.
// If that fails, let the sound system try and figure it out.
if (strncmp ((const char *)sfxdata, "Creative Voice File", 19) == 0)
{
sfx->data = GSnd->LoadSoundVoc(sfxdata, size);
}
// If the sound is raw, just load it as such.
else if (sfx->bLoadRAW)
{
sfx->data = GSnd->LoadSoundRaw(sfxdata, size, sfx->RawRate, 1, 8, sfx->LoopStart);
}
// Otherwise, try the sound as DMX format.
else if (((BYTE *)sfxdata)[0] == 3 && ((BYTE *)sfxdata)[1] == 0 && dmxlen <= size - 8)
{
int frequency = LittleShort(((WORD *)sfxdata)[1]);
if (frequency == 0) frequency = 11025;
sfx->data = GSnd->LoadSoundRaw(sfxdata+8, dmxlen, frequency, 1, 8, sfx->LoopStart);
}
// If that fails, let the sound system try and figure it out.
else
{
sfx->data = GSnd->LoadSound(sfxdata, size);
Expand Down Expand Up @@ -2482,6 +2482,11 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
}
}
}
else
{
// Load an external file.
reader.reset(new FileReader(musicname));
}

// shutdown old music
S_StopMusic (true);
Expand Down
2 changes: 1 addition & 1 deletion src/sound/music_midistream.cpp
Expand Up @@ -285,7 +285,7 @@ MIDIDevice *MIDIStreamer::CreateMIDIDevice(EMidiDevice devtype) const
catch (CRecoverableError &err)
{
// The creation of an OPL MIDI device can abort with an error if no GENMIDI lump can be found.
Printf("Unable to create OPL MIDI device: %s\nFalling back to default sound system playback", err.GetMessage());
Printf("Unable to create OPL MIDI device: %s\nFalling back to Sound System playback", err.GetMessage());
return new SndSysMIDIDevice;
}

Expand Down

0 comments on commit 10083e8

Please sign in to comment.