From d3042e1eebf1768205bca287c7aa976daf9f6086 Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 15 Dec 2013 23:33:45 +0900 Subject: [PATCH] Updated YSR interface --- Sources/Audio/YsrDevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/Audio/YsrDevice.cpp b/Sources/Audio/YsrDevice.cpp index 41144bfd..0a022d8e 100644 --- a/Sources/Audio/YsrDevice.cpp +++ b/Sources/Audio/YsrDevice.cpp @@ -26,6 +26,7 @@ SPADES_SETTING(s_ysrDriver, "libysrspades.so"); #endif SPADES_SETTING(s_ysrNumThreads, "1"); +SPADES_SETTING(s_ysrBufferSize, "1024"); namespace spades { namespace audio { @@ -70,6 +71,7 @@ namespace spades { int sampleBits; int numChannels; int numSamples; + double samplingRate; }; struct PlayParam { float volume; @@ -301,6 +303,7 @@ namespace spades { param.data = reinterpret_cast(buffer.data()); param.numChannels = stream->GetNumChannels(); param.numSamples = static_cast(stream->GetNumSamples()); + param.samplingRate = stream->GetSamplingFrequency(); switch(stream->GetSampleFormat()) { case IAudioStream::SignedShort: param.sampleBits = 16; @@ -359,7 +362,7 @@ namespace spades { spec.userdata = this; spec.format = AUDIO_F32SYS; spec.freq = 44100; - spec.samples = 1024; + spec.samples = (int)s_ysrBufferSize; spec.channels = 2; sdlAudioDevice = decltype(sdlAudioDevice)