question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NAudio needs support for asynchronicity (and probably .NET 4.0 and 4.5)

See original GitHub issue

.NET 4.0 added asynchronous operations to the definition of System.IO.Stream, and 4.5 took that a step further by providing future-promise asynchronous model with Task *Async() methods. NAudio currently targets .NET 3.5. This version did have a basic support for asynch operation (Begin{Read,Write}, although harder to use than the new style); but NAudio does not support even that. This indeed creates a problem on servers, like in my case when I am using an instance of WebResponseStream to construct a WaveFileReader. The latter blocks when reading data from the underlying stream, and that requires a complex thread management in a service program (I cannot block in a thread pool thread, since they are scarce).

NAudio is an amazing library, and would be awesome to keep it up with the way current architectures are developing.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:7
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kGurGallercommented, Sep 1, 2022

Any update on this? Seems like NAudio already has a build that targets newer .NET versions, so is it planned to support this? Async IO is a must in high-throughput server apps these days, so it is kind of a bummer that it is not supported by NAudio’s WaveStreams

0reactions
kkm000commented, Jun 18, 2016

No, not a problem as it is, just looks strange indeed. I could not understand what is the point of building a separate and (sometimes unintentionally) different configuration for unit testing only. I just want to understand the benefits.

But my main question is what is the better multitargeting approach. Could you please look at #99 and tell me what you think? (And as a side note, this is where testing one thing then releasing another may become even more tedious and risky, as the number of configuration needed to be kept in sync triples!)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Another adventure in downgrading, part 3: XP
Yes, you could downgrade the framework to .NET 4.0 perhaps, but you'd still miss the support for these technologies.
Read more >
November | 2022 | Scali's OpenBlog™
Yes, you could downgrade the framework to .NET 4.0 perhaps, but you'd still miss the support for these technologies.
Read more >
async/await keywords not available in .net 4.0
I've already explained what the problem is: Visual Studio needs to know about this at a language level. VS2010 only supports C# 4,...
Read more >
Support Ending for the .NET Framework 4, 4.5 and 4.5.1
NET Framework version that is no longer supported will not need to retarget or recompile to a newer version as they can be...
Read more >
Async in 4.5: Worth the Await - .NET Blog
The new async support is built on the Task Parallel Library (TPL) that was introduced in the .NET Framework 4. It uses the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found