[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.29,1.30
Nicolas Bacca
arisme at users.sourceforge.net
Thu Mar 14 18:24:04 CET 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv27853
Modified Files:
sound.cpp
Log Message:
Make mp3 sound work (pretty good btw) with WinCE
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** sound.cpp 14 Mar 2002 17:36:12 -0000 1.29
--- sound.cpp 15 Mar 2002 02:23:44 -0000 1.30
***************
*** 22,26 ****
#include "stdafx.h"
#include "scumm.h"
! #include "sound.h"
void Scumm::addSoundToQueue(int sound) {
--- 22,31 ----
#include "stdafx.h"
#include "scumm.h"
! #include "sound.h"
!
! #ifdef _WIN32_WCE
! extern void *bsearch(const void *, const void *, size_t,
! size_t, int (*x)(const void *, const void *));
! #endif
void Scumm::addSoundToQueue(int sound) {
***************
*** 162,169 ****
#ifdef COMPRESSED_SOUND_FILE
if (offset_table != NULL) {
! OffsetTable *result, key;
key.org_offset = offset;
! result = (OffsetTable *) bsearch(&key, offset_table, num_sound_effects, sizeof(OffsetTable), compar);
if (result == NULL) {
warning("startTalkSound: did not find sound at offset %d !", offset);
--- 167,175 ----
#ifdef COMPRESSED_SOUND_FILE
if (offset_table != NULL) {
! OffsetTable *result = NULL, key;
key.org_offset = offset;
! result = (OffsetTable *) bsearch(&key, offset_table, num_sound_effects, sizeof(OffsetTable), compar);
!
if (result == NULL) {
warning("startTalkSound: did not find sound at offset %d !", offset);
***************
*** 359,363 ****
int block_type;
byte work[8];
! uint size,i;
int rate,comp;
byte *data;
--- 365,369 ----
int block_type;
byte work[8];
! uint size = 0,i;
int rate,comp;
byte *data;
***************
*** 543,547 ****
mc->_sfx_sound = sound;
! mad_stream_init(&mc->sound_data.mp3.stream);
mad_frame_init(&mc->sound_data.mp3.frame);
mad_synth_init(&mc->sound_data.mp3.synth);
--- 549,559 ----
mc->_sfx_sound = sound;
! mad_stream_init(&mc->sound_data.mp3.stream);
!
! #ifdef _WIN32_WCE
! // 11 kHz on WinCE
! mad_stream_options((mad_stream*)&mc->sound_data.mp3.stream, MAD_OPTION_HALFSAMPLERATE);
! #endif
!
mad_frame_init(&mc->sound_data.mp3.frame);
mad_synth_init(&mc->sound_data.mp3.synth);
More information about the Scummvm-git-logs
mailing list