Closed Baron1234 closed 9 years ago
There is no WAV.cs file. Post the whole exception including the exception.
So I'm having the same/similar problem. the audioClient.StreamLatency is returning 0 and as a result I'm getting an ArgOutOfRangeException when it sets the Latency to 0
System.ArgumentOutOfRangeException was unhandled Message=Specified argument was out of the range of valid values. Parameter name: value ParamName=value Source=CSCore StackTrace: at CSCore.SoundOut.WasapiOut.set_Latency(Int32 value) in C:\dev\cscore\CSCore\SoundOut\WasapiOut.cs:line 176 at CSCore.SoundOut.WasapiOut.InitializeInternal() in C:\dev\cscore\CSCore\SoundOut\WasapiOut.cs:line 570 at CSCore.SoundOut.WasapiOut.Initialize(IWaveSource source) in C:\dev\cscore\CSCore\SoundOut\WasapiOut.cs:line 215 at FadingSample.Program.Main(String[] args) in C:\dev\cscore\Samples\FadingSample\Program.cs:line 36 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
It could also be this. Just simply doing
new WaveFileReader(@"wavefile.wav");
In WaveFileReader.ReadChunks:158, the ChunkDataSize comes out as -2088467324
Update: When it reads a datachunk, it appears to not skip the data section and continue trying to read headers. Inverting the condition fixed it.
System.ArgumentOutOfRangeException was unhandled Message=Non-negative number required. Parameter name: value ParamName=value Source=mscorlib StackTrace: at System.IO.FileStream.set_Position(Int64 value) at CSCore.Codecs.WAV.WaveFileReader.ReadChunks(Stream stream) in C:\dev\cscore\CSCore\Codecs\WAV\WaveFileReader.cs:line 158 at CSCore.Codecs.WAV.WaveFileReader..ctor(Stream stream) in C:\dev\cscore\CSCore\Codecs\WAV\WaveFileReader.cs:line 53 at FadingSample.Program.Main(String[] args) in C:\dev\cscore\Samples\FadingSample\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
Is that wave file issue still reproducible with the latest source? And is there still the problem with the audioclients latency?
Got fixed by pull request from @garylesueur . see #2
Running FadingSample will throw an exception at CSCore\Codecs\WAV.cs :line 64. when choose .wav music. I am a new learner and don't wha't wrong with this problem, would you known the reason?