I am working on a telephony application using a third party library to send audio across the wire.

This third party library only accepts a very specific wav format, and takes in the file as a filename path on disk. Our current audio files are not in this format. I can use NAudio to convert from our legacy format to this new format.

However, I don't really want two sets of audio files floating around.

What I basically want to do is take an NAudio.WaveStream and be able to pass it to the third party library without writing it to disk, because the library takes a path to a filename. If performance is bad, I will be forced to have multiple sets of audio files, but I would like to avoid this. I am not even sure what terms to Google.

Is this a use case for memory mapped files?

有帮助吗?

解决方案

Probably not worth your while but if you're absolutely stuck with the 3rd party app and are against writing to disk you could create a virtual drive using a library like http://dokan-dev.net/en/. You could intercept the requests from the 3rd party app and stream the converted files to it as they were needed.

Saying that, I would probably take the hit on writing the files to a normal drive.

If nothing else it'll kick off your searches.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top