NAudio with native aot #1103
Replies: 3 comments 2 replies
-
I haven't tried it, but I suspect it is not possible I'm afraid. You could try setting true and compiling and I suspect that there would be warnings from the analyzers |
Beta Was this translation helpful? Give feedback.
-
Probably, use GeneratedComInterface? |
Beta Was this translation helpful? Give feedback.
-
We have NAudio running NativeAOT on the xbox (community - wrapped NativeAOT compile) and under windows. NativeAOT allows for com. We had to change a few things like the WaveHeader needed to be a struct and then the memory for it declared using AllocHGlobal and then cleared in the deconstructor (dispose). The calls to WaveInterop had to be changed to using IntPtrs instead of the WaveHeader class. This is because the header has to be written to from the com side and obviously that cant happen using the current code. Specifically for the xbox running NativeAOT, we had to add a few things into the interop like "waveOutMessage" and "waveInMessage" to get the default audio device since the xbox cant declare using device ID "-1". Minor changes really, and the same code runs under regular windows and xbox windows. This is of course all using the WinMM portion of NAudio. So its definitely possible and quite easy. |
Beta Was this translation helpful? Give feedback.
-
Is there a way i can use this amazing libraray in . net core 8 application with AOT native publish.
any help or clue to do so please.
Beta Was this translation helpful? Give feedback.
All reactions