protyposis / Aurio

Audio Fingerprinting & Retrieval for .NET
GNU Affero General Public License v3.0
136 stars 28 forks source link

Decoding of videofiles not working #12

Closed Johndirr closed 5 years ago

Johndirr commented 5 years ago

When no wav or mp3 files are used in the sample application "Aurio.Test.FingerprintingHaitsmaKalker2002" there will be an exception: "System.NotSupportedException: 'Cannot open file with NAudio'" in NAudioStreamFactory.cs

Looks like FFmpegAudioStreamFactory is not used at all.

Johndirr commented 5 years ago

How would I be able to force the application to use FFmpeg instead of NAudio?

// Use FFmpeg for file reading/decoding AudioStreamFactory.AddFactory(new FFmpegAudioStreamFactory());

This seems to not to work at all. One FFmpegAudioStreamFactory gets added but later on when loading the audiotrack with AudioTrack audioTrack = new AudioTrack(new FileInfo(fileName)); are we not moving over the added factory instead of using it? AudioStreamFactory.cs:

private static IAudioStream TryOpenSourceStream(FileInfo fileInfo) {
            if (factories.Count == 0)
            {
                throw new NotSupportedException("Cannot open file " + fileInfo.FullName);
            }

            var factoryEnumerator = factories.GetEnumerator();
            factoryEnumerator.MoveNext()
...
protyposis commented 5 years ago

Cannot reproduce. When I start Aurio.Test.FingerprintingHaitsmaKalker2002 and click Scan files I can select video files (e.g. mp4 or mkv) and they are processed as expected.

Johndirr commented 5 years ago

I don't know why but when I ran the same application today it worked. Sorry for the confusion.