- fix for music sample rates >48k. issue #221

This commit is contained in:
Fledge68 2020-11-14 15:21:40 -06:00
parent e6beda957a
commit c629021a44
5 changed files with 4 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL" #define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.4.8" #define APP_VERSION "5.4.9 beta 1"
#define APP_DATA_DIR "wiiflow" #define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow" #define APPS_DIR "apps/wiiflow"

View File

@ -108,7 +108,7 @@ void SoundDecoder::EnableUpsample(void)
if( (ResampleBuffer == NULL) if( (ResampleBuffer == NULL)
&& IsStereo() && Is16Bit() && IsStereo() && Is16Bit()
&& SampleRate != 32000 && SampleRate != 32000
&& SampleRate != 48000) && SampleRate < 48000)
{ {
ResampleBuffer = (u8*)memalign(32, SoundBlockSize); ResampleBuffer = (u8*)memalign(32, SoundBlockSize);
ResampleRatio = ( FixedPointScale * SampleRate ) / 48000; ResampleRatio = ( FixedPointScale * SampleRate ) / 48000;

View File

@ -56,7 +56,7 @@ public:
virtual int Seek(int pos) { CurPos = pos; return file_fd->seek(CurPos, SEEK_SET); }; virtual int Seek(int pos) { CurPos = pos; return file_fd->seek(CurPos, SEEK_SET); };
virtual int Rewind(); virtual int Rewind();
virtual u8 GetFormat() { return Format; } virtual u8 GetFormat() { return Format; }
virtual u16 GetSampleRate() { return SampleRate; } virtual u32 GetSampleRate() { return SampleRate; }
virtual void Decode(); virtual void Decode();
virtual u32 GetBufferSize() { return SoundBuffer.GetBufferSize(); }; virtual u32 GetBufferSize() { return SoundBuffer.GetBufferSize(); };
virtual u8 * GetBuffer() { return SoundBuffer.GetBuffer(); }; virtual u8 * GetBuffer() { return SoundBuffer.GetBuffer(); };
@ -94,7 +94,7 @@ protected:
bool Decoding; bool Decoding;
bool ExitRequested; bool ExitRequested;
u8 Format; u8 Format;
u16 SampleRate; u32 SampleRate;
u8 *ResampleBuffer; u8 *ResampleBuffer;
u32 ResampleRatio; u32 ResampleRatio;
}; };