filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

CSCore not building #414

Open Aisuruneko opened 4 years ago

Aisuruneko commented 4 years ago

Hey, So recently, I wanted to dive into CSCore, however I am experiencing issues immediately after getting the source and building. I could not build CSCore even if I set this my PostBuildEvent

set target=$(TargetPath)
set project=$(ProjectPath)
set sdk=%PROGRAMFILES(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools
set framework=%WINDIR%\Microsoft.NET\Framework\v2.0.50727

if $(ConfigurationName) == Debug set ilasm_args=/DLL /DEBUG=IMPL
if $(ConfigurationName) == Release set ilasm_args=/DLL /OPTIMIZE

call "$(SolutionDir)Tools\InlineILCompiler\InlineILCompiler\bin\$(ConfigurationName)\InlineILCompiler.exe"

call "$(SolutionDir)Tools\CSCli\bin\$(ConfigurationName)\CSCli.exe" -file:"$(TargetPath)" -r:"RemoveObjAttribute" -c:"CSCalliAttribute"

exit /b 0

It says it failed with exit code -1.

I remove the PostBuildEvent scripting, and build it, and it builds. I then try to play with Samples, to try to understand what this thing can do, so I try visualization and equalizer... a crash with System.NotImplementedException: 'The method or operation is not implemented.'

I am running Windows 10 Home 1903 on a Lenovo Ideapad S145, Visual Studio 2019.

Exception thrown: 'System.NotImplementedException' in CSCore.dll
Exception thrown: 'System.NotImplementedException' in CSCore.dll
Exception thrown: 'System.NotImplementedException' in CSCore.dll
System.NotImplementedException: The method or operation is not implemented.
at CSCore.MediaFoundation.InteropCalls.CalliMethodPtr(Void* _basePtr, Void* p) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\InteropCalls.cs:line 69
   at CSCore.MediaFoundation.MFByteStream.CloseNative() in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MFByteStream.cs:line 374
   at CSCore.MediaFoundation.MFByteStream.Close() in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MFByteStream.cs:line 382
   at CSCore.MediaFoundation.MFByteStream.Dispose(Boolean disposing) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MFByteStream.cs:line 396
   at CSCore.Win32.ComObject.Dispose() in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\Win32\ComObject.cs:line 160
   at CSCore.MediaFoundation.MediaFoundationDecoder.DisposeInternal() in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MediaFoundationDecoder.cs:line 390
   at CSCore.MediaFoundation.MediaFoundationDecoder.Initialize(MFSourceReader reader) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MediaFoundationDecoder.cs:line 292
   at CSCore.MediaFoundation.MediaFoundationDecoder.Initialize(MFByteStream byteStream) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MediaFoundationDecoder.cs:line 238
   at CSCore.MediaFoundation.MediaFoundationDecoder..ctor(Stream stream) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\MediaFoundation\MediaFoundationDecoder.cs:line 64
   at CSCore.Codecs.MP3.Mp3MediafoundationDecoder..ctor(Stream stream) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\Codecs\MP3\Mp3MediafoundationDecoder.cs:line 43
   at CSCore.Codecs.CodecFactory.<>c.<.ctor>b__2_0(Stream s) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\Codecs\CodecFactory.cs:line 42
   at CSCore.Codecs.CodecFactory.GetCodec(String filename) in C:\Users\Matthew\VS\Projects\Other\cscore-master\CSCore\Codecs\CodecFactory.cs:line 163

I am so confused and I have tried Googling and looking through the Github Issues, but I can't find anything. Some help would be absolutely appreciated.

priowrea commented 4 years ago

The postbuild script is mandatory for some parts of cscore. Therefore you have to fix the postbuild script for your needs.

https://docs.microsoft.com/de-de/cpp/build/reference/common-macros-for-build-commands-and-properties?view=vs-2019 $(ConfigurationName) is not listed anymore for VS 2019.

Therefore try to replace the $(ConfigurationName) variable could help, e.g.: set inlineILCompiler=$(ProjectDir)..\Tools\InlineILCompiler\$(OutDir)InlineILCompiler.exe set cscli=$(ProjectDir)..\Tools\CSCli\$(OutDir)CSCli.exe

GunArm commented 3 years ago

Same problem here. This seems really neat to mess around with, and I tried setting it up, but it's non-functional in it's commited state. I tried looking for documentation about how to just get it to compile but there doesn't seem to be any.

I did install a big fat windows SDK, and updated the path in the csproj build step. But then it gives this error?

1>  ilasm "C:\code\cscore\CSCore\bin\Debug\disasm.il" /DLL /DEBUG=IMPL /output="C:\code\cscore\CSCore\bin\Debug\CSCore.dll"
1>EXEC : error : Process 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\ilasm.exe' failed with exit code '1