Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioFileReader : Read zip file as audio #1160

Open
LiuYunPlayer opened this issue May 24, 2024 · 0 comments
Open

AudioFileReader : Read zip file as audio #1160

LiuYunPlayer opened this issue May 24, 2024 · 0 comments

Comments

@LiuYunPlayer
Copy link

As shown in the code below, I tried to use AudioFileReader to read the file to determine whether it was an audio file by whether it threw an exception. However, when I used it to read the zip file, I was surprised to find that it threw no exception.

public static bool TryGetAudioInfo(string path, [NotNullWhen(true)] out AudioInfo audioInfo)
{
    audioInfo = new AudioInfo();
    try
    {
        using (var reader = new AudioFileReader(path))
        {
            audioInfo.duration = reader.TotalTime.TotalSeconds;
            return true;
        }
    }
    catch
    {
        return false; 
    }
}

OpenSVIP4TuneLab-v1.0.0.zip

When I tried to debug it, I got this:
C`PCJGBC@C}313U{@_UR($F

NAudio version: 2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant