diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index e4e20d2e08..d9951b596e 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -153,7 +153,7 @@ public: int GetLength() const { return 0; } int GetLength_Fast() const { return 0; } int SetPosition( int iFrame ) { return 1; } - int Read( int16_t *pBuf, int iFrames ) { return RageSoundReader::END_OF_FILE; } + int Read( float *pBuf, int iFrames ) { return RageSoundReader::END_OF_FILE; } RageSoundReader *Copy() const { return new RageSoundReader_Silence; } int GetSampleRate() const { return 44100; } unsigned GetNumChannels() const { return 1; } @@ -270,7 +270,7 @@ void RageSound::LoadSoundReader( RageSoundReader *pSound ) * conditions are masked and will be seen on the next call. Otherwise, the requested * number of frames will always be returned. */ -int RageSound::GetDataToPlay( int16_t *pBuffer, int iFrames, int64_t &iStreamFrame, int &iFramesStored ) +int RageSound::GetDataToPlay( float *pBuffer, int iFrames, int64_t &iStreamFrame, int &iFramesStored ) { /* We only update m_iStreamFrame; only take a shared lock, so we don't block the main thread. */ // LockMut(m_Mutex); diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 3cee34f706..93a1c7abbb 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -16,7 +16,7 @@ class RageSoundBase public: virtual ~RageSoundBase() { } virtual void SoundIsFinishedPlaying() = 0; - virtual int GetDataToPlay( int16_t *buffer, int size, int64_t &iStreamFrame, int &got_bytes ) = 0; + virtual int GetDataToPlay( float *buffer, int size, int64_t &iStreamFrame, int &got_bytes ) = 0; virtual void CommitPlayingPosition( int64_t iFrameno, int64_t iPosition, int iBytesRead ) = 0; virtual int GetSampleRate() const = 0; virtual RageTimer GetStartTime() const { return RageZeroTimer; } @@ -193,7 +193,7 @@ public: * signals the stream to stop; once it's flushed, SoundStopped will be called. * Until then, SOUNDMAN->GetPosition can still be called; the sound is still * playing. */ - int GetDataToPlay( int16_t *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead ); + int GetDataToPlay( float *pBuffer, int iSize, int64_t &iStreamFrame, int &iBytesRead ); void CommitPlayingPosition( int64_t iHardwareFrame, int64_t iStreamFrame, int iGotFrames ); }; diff --git a/stepmania/src/arch/Sound/RageSoundDriver.h b/stepmania/src/arch/Sound/RageSoundDriver.h index d8de8642a3..3278432d98 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver.h +++ b/stepmania/src/arch/Sound/RageSoundDriver.h @@ -145,8 +145,8 @@ private: */ struct sound_block { - int16_t m_Buffer[samples_per_block]; - int16_t *m_BufferNext; // beginning of the unread data + float m_Buffer[samples_per_block]; + float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext int64_t m_iPosition; // stream frame of m_BufferNext sound_block() { m_FramesInBuffer = m_iPosition = 0; m_BufferNext = m_Buffer; } diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 0671164815..5b30d3bb27 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -127,7 +127,6 @@ RageSoundMixBuffer &RageSoundDriver::MixIntoBuffer( int iFrames, int64_t iFrameN /* Note that, until we call advance_read_pointer, we can safely write to p[0]. */ const int frames_to_read = min( iFramesLeft, p[0]->m_FramesInBuffer ); - mix.SetVolume( s.m_fVolume ); mix.SetWriteOffset( iGotFrames*channels ); mix.write( p[0]->m_BufferNext, frames_to_read * channels );