Corey-M/NAudio.Lame

Incompatibility with NAudio 2.0.0-beta1

Closed this issue · 10 comments

When traing to upgrade NAudio from 1.10 to 2.0 beta 1, the code does not compile anymore and throws an error:

Gravité	Code	Description	Projet	Fichier	Ligne	État de la suppression
Erreur	CS0012	Le type 'WaveFormat' est défini dans un assembly qui n'est pas référencé. Vous devez ajouter une référence à l'assembly 'NAudio, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null'.	Common.Audio	C:\Users\Patrick\source\repos\Project\Common.Audio\CachedSound.cs	251	Actif

It is missing an assembly 'NAudio, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null' and does not seem to recognize the new version.

The error occurs at this line of my code:

using (LameMP3FileWriter writer = new LameMP3FileWriter(fileName, mp3WaveFormat, bitRate))

The usings are (unchanged):

using NAudio.Wave;
using NAudio.Lame;

NAudio 2 is in beta so the package splits are still provisional. Once Mark releases the final 2.0.0 package then I can do a new version of NAudio.Lame that works with it. This will give me a chance to sync the version numbers with NAudio, which I should have done ages ago. Going forward the NAudio.Lame major and minor version numbers will indicate the required NAudio version.

In the meantime feel free to fork the source and make the required changes yourself. If you just update all of the NAudio nuget packages to the pre-release version it will work. Alternatively you can remove the existing package from LameDLLWrap and NAudio.Lame and replace them with NAudio.Core. You'll have to unload the test packages,. or include the full NAudio pre-release package in those ones since they use AudioFileReader which is only in the main package at the moment.

If you go this route you'll need to do a batch build to get all the LameDLLWrap variants built.

NAudio 2 has been released now. And NAudio.Lame should only need to take a dependency on NAudio.Core assuming all you need is WaveFormat

@markheath Thanks Mark. I'll have a look at the new packages but I expect you're right. Should be simple enough to adjust.

Do you have any plans to continue support for the old 1.x branch?

@Darkfrogger NAudio.Lame v2.0.0 is up on NuGet. Check it out, let me know if I broke anything.

@markheath Thanks Mark. I'll have a look at the new packages but I expect you're right. Should be simple enough to adjust.

Do you have any plans to continue support for the old 1.x branch?

I'm hoping that the backwards compatibility of v2 should mean that most people don't need to stay on 1.x, but I can always backport a bugfix to the old branch if it's needed.

It compiles fine but when I run the Application I get the following error (other of the same kind to)

image

@Darkfrogger NAudio.Lame depends on NAudio.Core. That error message looks like the error might be a problem with your NAudio references. Can you try creating a fresh solution and add NAudio.Lame by itself and see if you can replicate the problem?

I will try some more later. Currently I removed all Nugets and added NAudio, NAudio.Lame and NAudio.Core but the issue remains.

Did the same on a 'clean' machine and got no issues, 32- and 64-bit code compiles and runs fine. What sort of project are you building and what architecture? If it's ASP.Net then this might be a regression on the type loader workaround.

Closing as not reproducible and no response received.