GithubHelp home page GithubHelp logo

zeugma440 / atldotnet Goto Github PK

View Code? Open in Web Editor NEW
422.0 24.0 59.0 66.69 MB

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets

License: MIT License

C# 99.98% PLSQL 0.02%
audio opus tak m4a ogg-vorbis cuesheet dsf mp3 playlist reader

atldotnet's Introduction

Audio Tools Library (ATL) for .NET NetCore NetStandard .NET

Latest stable version : NuGet

Optimized with : ReSharper, BenchmarkDotNet and CodeTrack

Current status

.NET codecov Quality Gate Status

What is ATL .NET ?

This library is aimed at giving .NET developers a managed, portable and easy-to-use library to read and write metadata from digital audio files and playlists with one single unified API, whatever the underlying format.

using ATL.AudioData;

// Initialize with a file path
Track theTrack = new Track(audioFilePath);

// Works the same way on any supported format (MP3, FLAC, WMA, SPC...)
System.Console.WriteLine("Title : " + theTrack.Title);
System.Console.WriteLine("Duration (ms) : " + theTrack.DurationMs);

theTrack.Composer = "Oscar Wilde (アイドル)"; // Support for "exotic" charsets
theTrack.AdditionalFields["customField"] = "fancyValue"; // Support for custom fields
theTrack.Save();

// Can alternatively be initialized with a Stream
theTrack = new Track(stream);

You'll find more working code on the Code snippets section of the Documentation, including what you need to manage embedded pictures (e.g. cover), chapters , lyrics and playlists

What is NOT ATL .NET ?

Audio Tools Library .NET is not

  • a standalone application : it is a library aimed at being used by developers to build software

  • an audio music player : it gives access to various properties and metadata (see below for the comprehensive list), but does not process audio data into an audible signal

Why open source ?

ATL has been open source since its creation. The original ATL 2.3 source written in Pascal language is still out there on Sourceforge !

By publicly sharing the result of their work, the MAC team has helped many developers to gain tremendous time in creating audio tools.

As a fellow audiophile and developer, I'm proudly extending and improving their initial contribution to the open source community.

Why would I want to use ATL while TagLib is out there ?

  • ATL has a full C# implementation and does not use any dependency, which makes portability trivial if your app is already based on .NET or Mono frameworks

  • ATL can auto-detect the format of the audio data you're using, even if the file extension has the wrong label or if you're feeding it raw data witout context

  • ATL features a flexible logging system which allows you to catch and record audio file reading/writing incidents into your app

  • ATL supports more audio formats than TagLib, including video game audio formats (SPC, PSF, VGM, GYM)

  • ATL supports chapters natively

  • ATL supports lyrics natively

  • ATL supports BEXT, LIST (general metadata, labels and notes), CUE (cue points), SMPL (sample loops), DISP (displayable objects), XMP, CART and iXML metadata chunks in RIFF / WAV files

  • ATL supports Playlists and Cuesheets

  • ATL supports async calls on writing operations

How to use it ? Which platforms and .NET/Mono versions does ATL run on ?

The ATL library runs on .NET Core 3.1+ / .NET Standard 2.1+ / .NET 6+

ATL unit tests run on .NET 6+

The library and its tests have been maintained on Visual Studio Express and Community (currently on Community 2022)

Please refer to the Code snippets section of the Documentation for quick usage

What kind of data can ATL actually read ? From which formats ?

SUPPORTED AUDIO FORMATS AND TAGGING STANDARDS

NB1 : Empty cells mean "not applicable for this audio format"

NB2 : All metadata is read according to Unicode/UTF-8 encoding when applicable, which means any "foreign" character (japanese, chinese, cyrillic...) will be recognized and displayed properly

R= Read / W= Write

Audio format Extensions ID3v1.0-1.1 support ID3v2.2-2.4 support (1) APEtag 1.0-2.0 support Format-specific tagging support
Advanced Audio Coding, Apple Lossless (ALAC) .AAC, .MP4, .M4A, .M4B R/W R/W R/W R/W
Apple Core Audio .CAF (5)
Audible .AAX, .AA R/W R/W R/W R/W
Audio Interchange File Format .AIF, .AIFF, .AIFC R/W R/W
Digital Theatre System .DTS
Direct Stream Digital .DSD, .DSF R/W
Dolby Digital .AC3 R/W
Extended Module .XM R/W (2)
Free Lossless Audio Codec .FLAC R/W R/W
Genesis YM2612 .GYM R/W
Impulse Tracker .IT R/W (2)
Musical Instruments Digital Interface .MID, .MIDI R/W (3)
Monkey's Audio .APE R/W R/W R/W
MPEG Audio Layer .MP1, .MP2, .MP3 R/W R/W R/W
MusePack / MPEGplus .MPC, .MP+ R/W R/W R/W
Noisetracker/Soundtracker/Protracker .MOD R/W (2)
OGG : Vorbis, Opus, Embedded FLAC .OGG, .OGA, .OPUS R/W
OptimFROG .OFR, .OFS R/W R/W R/W
Portable Sound Format .PSF, .PSF1, .PSF2, .MINIPSF, .MINIPSF1, .MINIPSF2, .SSF, .MINISSF, .DSF, .MINIDSF, .GSF, .MINIGSF, .QSF, .MINIQSF R/W
ScreamTracker .S3M R/W (2)
SPC700 (Super Nintendo Sound files) .SPC R/W
Toms' losslesss Audio Kompressor .TAK R/W
True Audio .TTA R/W R/W R/W
TwinVQ .VQF R/W
PCM (uncompressed audio) .WAV, .BWAV, .BWF R/W R/W R/W (4)
Video Game Music (SEGA systems sound files) .VGM, .VGZ R/W
WavPack .WV R/W
Windows Media Audio/Advanced Systems Format .WMA, .ASF R/W

(1) : ATL reads ID3v2.2, ID3v2.3 and ID3v2.4 tags, but only writes ID3v2.3 tags and ID3v2.4 tags

(2) : all sample names appear on the track's Comment field. Track title only is editable

(3) : MIDI meta events appear on the track's Comment field

(4) : Support for LIST (general metadata, labels and notes), CUE (cue points), SMPL (sample loops), DISP (displayable objects), BEXT, CART, XMP and iXML metadata chunks

(5) : Reads audio properties only, due to the rarity of sample CAF files tagged with actual metadata

DETECTED FIELDS

Audio properties (from audio data)

Bitrate, Bit depth (bits per sample), Sample rate, Duration, VBR, Codec family, Channels count and arrangement

Standard metadata (from tags)

  • Titles : Track title, Album title, Original album title, Content group description

  • People & Organizations : Track artist, Album artist, Original artist, Composer, Conductor, Lyricist, Publisher, Involved people, Series title / Movement name

  • Count & Indexes : Track number, Total tracks, Disc number, Total discs, Album, Rating, Album sort order, Album artist sort order, Artist sort order, Title sort order, Series part / Movement index

  • Dates : Recording Year and Date, Original Release Year and Date, Publishing Date

  • Identifiers : ISRC, Catalog Number

  • Ripping & Encoding : Encoded By, Encoder

  • URLs : Audio Source URL

  • Style : Genre, Beats Per Minute (BPM)

  • Miscellaneous : Comment, Description, Long description (also known as "Podcast description"), Language, Copyright, Embedded pictures, Chapters, Unsynchronized and synchronized Lyrics using the LRC or ID3v2 format

Custom metadata

Any other field that might be in the tag is readable and editable by ATL. More information can be found on the dedicated page

NB : Most metadata will be read "as is", with minimal alteration. If your file has invalid tags (e.g. chapter start timecode located after file duration), ATL will give you back that information without trying to auto-correct it.

Industry standards

ATL supports the following industry standards :

  • Broadcast wave / BEXT (EBU – TECH 3285) for WAV files
  • Broadcast wave / CART (AES Standard AES46-2002) for WAV files
  • Broadcast wave / iXML for WAV files
  • XMP (ISO 16684–1) for MP4/M4A and WAV files

SUPPORTED PLAYLISTS FORMATS

  • Read and write : ASX, B4S, M3U, M3U8, PLS, SMIL (including WPL and ZPL), XSPF, DPL (PotPlayer playlist)
  • Read-only : FPL (Foobar2000 playlist)

See detailed compatibility table here

SUPPORTED CUESHEETS FORMATS

CUE

What is the roadmap of ATL.NET ?

  • Support for Broadcast wave metadata : aXML
  • Support for other audio file formats : Speex
  • Connectors to other library file formats (e.g. iTunes)

NB : Any user request that can be granted quickly will take priority over the roadmap

Does ATL.NET include code authored by other people ?

ATL.NET is based on :

  • Audio Tools Library 2.3 by Jurgen Faul, Mattias Dahlberg, Gambit, MaDah and Erik Stenborg (code ported from Pascal to C# and refactored)

  • MIDI class 1.5 by Valentin Schmidt & Michael Mlivoncic (code ported from PHP to C# and refactored)

Special thanks for their contributions to...

leglubert, tarrats, DividedSE, audiamus

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐

atldotnet's People

Contributors

dependabot[bot] avatar fsobolev avatar melinyi avatar nlogozzo avatar numpsy avatar sandreas avatar skolmer avatar zeugma440 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atldotnet's Issues

Saved mp3 metadata with album art do not show the album art as icon in Win10

The problem

Loaded an MP3 with your test code for loading. Track info and image show correctly. Used your test code to save 2 lines of metadata (used verbatim). Image that was previously showing before in Windows 10 large icon view now shows the default mp3 icon. Note: the album art image was not one of the items changed.

Loaded the mp3 into mp3tag did nothing other than save the tag again and it nows shows again in windows.

No errors in log

Environment

2.16 on Windows 10 1809.

Interestingly m4b files when saved do continue to correctly show their artwork.

[ENHANCEMENT] setting for explicitly adding the TIT2 CTOC subframe

The problem

Now that TIT2 CTOC subframe is added, and following the behaviour from issue #3, it might be nice--and also nice for testing purposes--to have a global setting for explicitly ADDING said subframe.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.8 (master branch)
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

Probably something along the lines of:

public static bool ID3v2_alwaysWriteTIT2SubFrame = true;

It would be extra cool--again for testing or even branding purposes--to be also able to define the actual TIT2 string, as right now it's set to:

Table of Contents

So rather something like:

public static char[8] ID3v2_TIT2SubFrame = 'Contents';

Just a thought of course

Feature request please return duration in milliseconds, seconds is not precise enough for audiobooks

The problem

I want to use this library for an audobook chapterizer but it only returns time in seconds which can significantly throw off chapter marks when encoding. I had this problem when passing only pulling seconds with ffprobe and passing chapter data to ffmpeg to encode. This was fixed (for the most part) changing to milliseconds.

Please provide an option for those of us who need a more precise time measurement.

Non-issue Usage _ Code Snippet :: how to write the CTOC Additional Field with the ordered chapter UniqueIDs

The problem

This isn´t an issue per se; however, I'm confused as to how do I explicitly add/write the CTOC additional field after writing all chapters.

Environment

  • ATL version 2.3
  • Windows 10

Details

The ID3v2 chapters that get written with the ATLDOTNET library are FLAWLESS! However, some podcast clients like Overcast that do read them, cannot navigate through them. The only difference I've found so far in the ID3v2 tags from my chapter-enabled files and others out there is the CTOC Additional Field that lists the order of said chapters. The files with CTOC information in the ID3v2 tag can be navigated in podcast clients like Overcast.

I tried to no avail, thanks to my novice coding skills, to explicitly add a KeyValuePair<string, string>("CTOC", "toc");into theTag.AdditionalFields

But looking through the ATLDOTNET code I found that you've already added immense support to CTOC in ATL.AudioData.IO.ID3v2.writeChapters

I'd just like to know how to write the CTOC additional field, I thought that either expanding on the Chapter code snippet or creating a new one specifically for CTOC would be very much appreciated.

Code To Reproduce Issue

  1. Create two chapters:

thisChapter = new ATL.ChapterInfo();

thisChapter.UniqueID = chp0;
thisChapter.Title = One;
thisChapter.StartTime = 0;
thisChapter.EndTime = 10000;
theTag.Chapters.Add(thisChapter);

thisChapter.UniqueID = chp1;
thisChapter.Title = Two;
thisChapter.StartTime = 10000;
thisChapter.EndTime = 20000;
theTag.Chapters.Add(thisChapter);

  1. Create the CTOC, this is the request:

theTag.AdditionalFields.AddCTOC();

Persist the chapters and CTOC in the file:

theFile.UpdateTagInFile(theTag, MetaDataIOFactory.TAG_ID3V2);

  1. The result in the ID3v2 tag under AdditionalFields should be:

{[CTOC, toc
Key = "CTOC"
Value = "toc\0\u0003\u0006chp0\0chp1\0TIT2\0\0\0%\0\0\u0001ÿþ"

Thank you so much!

Update TAG Year

The problem

I don't know if I'm making a mistake, I'm trying to update the TAG "Year"

in this way:


Track trackFile = new Track(sTrackFile);
if (folderYear != trackFile.Year)
{
trackFile.Year = folderYear;
trackFile.Save();
}

the TAG in memory updates correctly, but after the "Save", the value returns to the previous value!

Environment

  • ATL 2.6
  • OS/version Window 10
  • Visual Studio 2017

Details

Code To Reproduce Issue [ Good To Have ]


Track trackFile = new Track(sTrackFile);
if (folderYear != trackFile.Year)
{
trackFile.Year = folderYear;
trackFile.Save();
}

Amitiés
Lionel

Date aka Recorded Date.

The problem

I'd like to use the recorded date of the podcasts I download in my program. With MediaInfo I can see that date as "Recorded_Date" (which is 'Date', see: this link)

But "theTrack.Date.ToString()" always produces "1-1-0001 00:00:00"

Environment

Visual Studio 16.5.0`Preview 1
.NET Core 3.1
ATL 2.14.0
Windows 10 Pro 1909

Code To Reproduce Issue [ Good To Have ]

Any mp3/m4a Podcast (I thnk) but here's an RSS Podcast feed: http://feeds.feedburner.com/pod-save-america

ATL unable to read some M4A files

The problem

I have a handful of audiobook files I've tested (and a ton i have not) that ATL is erroring when reading but they play and act (chapters work, etc) as expected in VLC, iTunes, and iOS devices.

The error I am getting is

d:/test.m4a | neither stco, not co64 atoms could not be found; aborting read [?=92155 ms]

I am not sure how these files are different please let me know what extra information (and how) i can extract and provide.

Environment

  • ATL version: 2.15
  • Last ATL version: NA
  • OS/version used to run ATL: VS2019, Win10, .net 4.8

Details

See above. I may be able to provide sample data but the smallest file is 500MB. Comparing it to a working M4A with mediainfo did not show anything odd to me but i'm pretty new at doing all this so won't pretend to be an expert.

Code To Reproduce Issue [ Good To Have ]

I am using your example code to read metadata

Several Playlist Format can't be opened by other software.

The problem

I saved 5 songs using atl 2.9 in all the formats supported by atl 2.9 (asx,b4s,wax,wvx,m3u,m3u8,pls,xspf,smi,smil,wpl).
Only m3u,m3u8 & pls properly opened in vlc & musicbee.
Atl 2.9 can open all playlist files but the spaces in filepath's replaced by %20 so bass(by un4seen) cant find the address of the song.
Even if i manully replace %20 by space in other playlist's vlc & musicbee still cant load it.
note:- Playlist formats(in notepad) are totally different than the samples provided in atl.

Environment

  • ATL 2.9:
  • Last ATL version that did not exhibit the issue (if applicable):
  • Windows 10 1809, Visual Studio 2019, WPF .net4.6.2

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

private readonly string _playlistFilter = Properties.Resources.PFilter;
private readonly string _savelistFilter = Properties.Resources.SFilter;
#region Playlist
private void LpMi_Click(object sender, RoutedEventArgs e)
{
var openFile = new OpenFileDialog()
{
Filter = _playlistFilter
};
if (openFile.ShowDialog() != true) return;
var theReader = PlaylistIOFactory.GetInstance().GetPlaylistIO(openFile.FileName);
foreach (var s in theReader.FilePaths)
{
LBoxSongPaths.Items.Add(s);
LBoxSongNames.Items.Add(Path.GetFileNameWithoutExtension(s));
}
}

    private void SpMi_Click(object sender, RoutedEventArgs e)
    {
        var saveFile = new SaveFileDialog()
        {
            Filter = _savelistFilter
        };
        if (saveFile.ShowDialog() != true) return;
        var pls = PlaylistIOFactory.GetInstance().GetPlaylistIO(saveFile.FileName); //Example 1.asx
        IList<string> pathsToWrite = new List<string>();
        foreach (var item in LBoxSongPaths.Items)
        {
            pathsToWrite.Add(item.ToString());
        }
        pls.FilePaths = pathsToWrite;
    }

Support for ID3v2.2-2.4 for WAV PCM?

The problem

Attempting to read metadata I've set in Audacity from a WAV file results in an empty AdditionalFields dictionary.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.3. The latest revision as of this writing, aab51be, also shows this behavior.
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10

Details

I'm writing a music looping system for Unity 3D, and I'm using ATL as the foundation for reading looping metadata a la the RPG Maker series of game engines. The idea is that each song is permitted to have two metadata entries indicating the start of a song's loop and how long that loop lasts before the song returns to the start of the loop.

These entries are completely custom tags, and so the assumption is that the AdditionalFields dictionary holds the metadata values. This proves to be behaving as expected with OGGs and AIFF (thus far in my testing), but WAVs are the exception. The tags I define do not appear.

Based on the table that lists the supported types, it appears there is WAV support for ID3v1. According to the Audacity documentation, Audacity only supports ID3v2. There is evidence to suggest that it once supported ID3v1 years ago but was eclipsed.

I'm unsure if there's anything in the roadmap to supporting ID3v2 for WAV, or if it's even possible considering the problems WAV has with metadata in general, but would it be worthwhile to consider?

[Performance] Better padding management

ATL performance at write time could be improved by managing padding correctly.

Current behaviour

  • ID3v2 : Existing padding is managed properly; there is no option to create padding when there is none Finalized
  • FLAC : Padding frames are ignored and deleted on update Finalized
  • OGG : The Settings.EnablePadding option allows to handle padding properly Finalized
  • MP4: Padding frames are ignored and deleted on update Finalized
  • Performance adjustments

Target behaviour

  • When padding is present : use it according to edited tag size (longer tag => shorter padding, and the other way around)
  • When no padding is present : create padding if the corresponding option is enabled

Duration precision

I noticed the duration is double but Track only has a rounded int version of it and we can't directly use AudioFileIO. So how can we get the double one?

Reading MP4 files or M4a files

Hi I want to be able to use this library to read M4a files from Mp4 files. Basically I am extracting the video portion separately for video processing and want to sync and play the extracted m4a portion from the mp4 file. Can you give an example of how to read a piece of audio frame from m4a and use it?

Error while updating mp3

The problem

Error while updating the following podcast (example)

LINK: https://podcast.npo.nl/file/nosop3techpodcast/5dc22df66c91c1adadc8d97bc50d486e/nporadio1_nos-op-3-tech-podcast-instagram-lanceert-igtv-en-een-nieuw-hoofdstuk-in-de-lootboxes-soap.mp3

Environment

  • ATL 2.4.1 Nuget
  • Windows / Visual Studio.

Details

CONSOLE OUTPUT:

Field code fixed length is 4; detected field 'replaygain_track_gain' is 21 characters long and cannot be written
at ATL.AudioData.IO.MetaDataIO.Write(BinaryReader r, BinaryWriter w, TagData tag)
at ATL.AudioData.AudioDataManager.UpdateTagInFile(TagData theTag, Int32 tagType)


Some more mp3 podcasts having the same error with different fields like this one:

LINK: https://podcast.npo.nl/file/joopcafe/1513/nporadio1_joopcafe_20180622_joop-cafe-67-met-francisco-van-jole-en-mei-li-vos.mp3

CONSOLE OUTPUT:

Field code fixed length is 4; detected field 'CREATION_TIME' is 13 characters long and cannot be written
at ATL.AudioData.IO.MetaDataIO.Write(BinaryReader r, BinaryWriter w, TagData tag)
at ATL.AudioData.AudioDataManager.UpdateTagInFile(TagData theTag, Int32 tagType)

Code To Reproduce Issue [ Good To Have ]

                try
                {
                    theTrack.Save();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("\n\r\n\rEXCEPTION: " + ex + "\n\r\n\r");
                }

Parse error

The problem

Parse some audio file and throw expection,but other audio file is fine.

Environment

  • ATL version : v2.3.0.0 from Nuget
  • VisualStudio2017 and .Net4.6.1
  • OS/version Win10 1709

Details

audio file

part of stack

Code To Reproduce Issue [ Good To Have ]

code from this

private int GetDurationTime(string osu_file_path)
        {
            string parent = Directory.GetParent(osu_file_path).FullName;

            string audio_path =Path.Combine(parent,GetAudioFilePath(osu_file_path));

            if (audio_path==null)
            {
                return -1;
            }

            var track = new Track(audio_path);

            Utils.Debug("duration:" + track.Duration);

            return track.Duration * 1000;//convert to ms
        }

[CLARIFICATION] Usage _ Code Snippets :: "Writing chapters in a tag" GetDataReader(string path) method is deprecated

The problem

"Writing chapters in a tag" code snippet should probably reflect the updated method GetFromPath. At some point after ATL v4.2 the GetDataReader(string path) method used for writing chapter information into a file got deprecated and--most likely--changed to GetFromPath(string path)

Environment

  • ATL version (or git revision) that exhibits the issue: 2.7
  • Last ATL version that did not exhibit the issue (if applicable): 2.4
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

My old implementation using ATL v4.2 called for the GetDataReader(string path) method as per the code snippet example. When I built ATL v4.7 the following building error was found:

Error CS1061 'AudioDataIOFactory' does not contain a definition for 'GetDataReader' and no extension method 'GetDataReader' accepting a first argument of type 'AudioDataIOFactory' could be found (are you missing a using directive or an assembly reference?)

Parsing ATL solution under AudioDataIOFactory showed that the method GetFromPath(string path) is now used to prepare a file for writing chapter information. After building, and a quick regression testing, my implementation worked as expected

Code To Reproduce Issue

private string removeChapters(string filePath)
{
	AudioDataManager theFile = new AudioDataManager(AudioDataIOFactory.GetInstance().GetDataReader(filePath));
            
	ATL.TagData theTag = new ATL.TagData();
	theTag.Chapters = new System.Collections.Generic.List<ATL.ChapterInfo>();

	theFile.UpdateTagInFile(theTag, MetaDataIOFactory.TAG_ID3V2);

	sConsole = "Removed all chapters... ";

	return sConsole;
}

Error when reading a .dsf file

Hello! First, thank you for supplying this project!

I am trying to read a .dsf file, using the code snippet you've supplied.

string fileName = "C:\\TestDSD\\DSF\\000334929725_01_01.dsf";

// Load audio file information into memory
Track theTrack = new Track(fileName);

Console.WriteLine("Title: " + theTrack.Title);
Console.WriteLine("Artist: " + theTrack.Artist);

But when it finished the "load audio file info" line, it gives me the following error:
Number was less than the array's lower bound in the first dimension.

I don't think it's an issue of your library not accepting the file format/extension, because .dsf is listed on your main page. Could you tell me what is going on?

Thank you in advance!

Unable to read MP3 metadata in .Net Standard

The problem

I am unable to read metadata from MP3 files using the latest atl Nuget package.

Environment

  • ATL version (or git revision) that exhibits the issue:
  • Last ATL version that did not exhibit the issue (if applicable):
  • OS/version used to run ATL

I'm using 2.42 from nuget in a .Net Standard 2.0 class library project being called by a UWP project I am working on. When I pulled down this project locally it did work for me using the same test files. I am running the latest version of Windows 10.

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

My project is here: https://github.com/mattjopete/chaptifier

ATLMetadataService.cs
public MetadataModel Read(string filePath)
{
Track track = new Track(filePath);
return track.ToMetadataModel();
}

MainPage.xaml.cs
private void ReadMetadata(StorageFile file)
{
var metadata = MetadataService.Read(file.Path);
}

TrackExtensions.cs
public static MetadataModel ToMetadataModel(this Track track)
{
return new MetadataModel
{
Title = track.Title,
ShowNotes = track.Description,
Chapters = track.Chapters.ToChapterModel()
};
}

ChapterExtensions.cs
public static IEnumerable<Models.ChapterModel> ToChapterModel(this IEnumerable<ChapterInfo> chapters)
{
var chapterCollection = new List<Models.ChapterModel>();
foreach(var chapter in chapters)
{
chapterCollection.Add(new Models.ChapterModel
{
Title = chapter.Title,
StartTime = chapter.StartTime,
EndTime = chapter.EndTime,
Picture = Image.FromStream(new MemoryStream(chapter.Picture.PictureData))
});
}
return chapterCollection;
}

thisChapter.Url no longer behaves as a hyperlink

The problem

Before the main branch 2.8 and all fixes, whenever in a podcast grabber supporting Chapters, if a chapter contained a well-formed hyperlink string for Url, clicking on the chapter text acted as a valid hyperlink taking you to the desired URL.

Environment

ATL version (or git revision) that exhibits the issue: 2.8 (main branch)
Last ATL version that did not exhibit the issue (if applicable): 2.7
OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

Following the convention for Chapter supported podcasts, the string value in the Chapter Url was of the form:

thisChapter.Url = "chapter url\0http://github.com/";

Which in a podcast grabber like Overcast (which supports Url) clicking the chapter gave way to the URL by clicking on it.

However, after v2.8 (main branch) the expected behaviour regressed, and no longer URL values are displayed, let alone have hyperlink functionality.

Code To Reproduce Issue

  1. Update a file with at least one chapter and the Url value != "":
using ATL.AudioData;

AudioDataManager theFile = new AudioDataManager(AudioDataIOFactory.GetInstance().GetFromPath(fileName));

TagData theTag = new TagData();
theTag.Chapters = new System.Collections.Generic.List<ChapterInfo>();

ChapterInfo ch = new ChapterInfo();
ch.StartTime = 0;
ch.StartOffset = 4294967295;
ch.EndTime = 12000;
ch.EndOffset = 4294967295;
ch.UniqueID = "chp0";
ch.Title = "Chapter 1";
ch.Subtitle = "";
ch.Url = "chapter url\0http://github.com/";
theTag.Chapters.Add(ch);
  1. Publish the resulting file in a Podcast RSS
  2. Use a podcast grabber like Overcast to visualize the newly updated RSS
  3. Play file and attempt to click on the chapter

Expected

Result

  • The chapter isn't clickable, it appears in plain text hence no webpage is displayed

Reading M4B fails but same file as M4A works

The problem

I was super excited to find this as I have been working on an audiobook chapterizer now that all the decent ones died with the death of quicktime but I have found that ATL appears to be unable to read M4B file data even though it is just an M4A.

Environment

  • ATL version: 2.15
  • Last ATL version: NA
  • OS/version used to run ATL: Win 10, VS 2018 .net 4.8

Details

I am using your sample code for reading metadata which works (in most cases but filing a 2nd bug for a few outliers) when the file extension is .m4a

Title : Test file
Artist : 
Album : Test author
Recording year : 2019
Track number : 0
Disc number : 0
Genre : Audiobook
Comment : this is a comment
Duration (s) : 28504
Bitrate (KBps) : 68
Number of channels : 2
Channels arrangement : Stereo (2/0.0)
Has variable bitrate audio : yes
Has lossless audio : no
Custom field ©too : value = Lavf58.17.101

but fails with m4b extension (it is really an m4b file I renamed back to m4a)

d:/test.m4b | Instancing a Dummy Audio Data Reader for d:/test.m4b [?=5476 ms]
d:/test.m4b | Instancing a Dummy Meta Data Reader [?=1 ms]
d:/test.m4b | Could not find any metadata [?=0 ms]
Title : test

Code To Reproduce Issue [ Good To Have ]

I am literally copying and using your sample read meta data code to test the ability of the library to read data I need.

Possible to remove specific tags?

Is there a way to remove a single (or set of) tags? I saw the Remove function in Track.cs but i'm unsure how this works it shows tagtype = 99 in intellisense which makes me think its to remove them all?

Unable to Read Certain ID3tags.

The problem

Yes, I am back again, as i mentioned previously there is some problem with atl tag features that i want to discuss.
I am going one by one all the different tags to read by atl. and i finally stuck with one atleast for now.
According to Wiki & ID3.org
The Tag "TDRC" (recording time) consolidates TDAT (date), TIME (time), TRDA (recording dates), and TYER (year).
I saved a TDRC tag using a 3rdparty tool(value 2009-05-19T04:04:04) but atl unable to read it.
Atmost it can only the year 2009 using TYER tag.

p.s. I will post other issue in this thread one by one when previous get solved.

Environment

  • ATL Latest
  • Windows 10 1809, VS2019.1.1, dotnet4.6.2, c#wpf

Code To Reproduce Issue [ Good To Have ]

var track1 = new Track(FileNameBox.Text);
if (track1.AdditionalFields.ContainsKey(NameBox.Text))
TbTag.Text = track1.AdditionalFields[NameBox.Text];

DSD "additional field

The problem

ATL does not seem to read the additional tags on the *.dsf files
"DISCTOTAL"
"TRACKTOTAL"

Environment

  • ATL version : 2.6
  • OS/version used to run ATL : Windows 10

Details

described in problem, I add that for *.flac, there is no problem

Code To Reproduce Issue [ Good To Have ]

aPropertiesList += "Disk : " + tagFile.DiscNumber + "/" + tagFile.AdditionalFields["DISCTOTAL"] + Environment.NewLine;

If you want a dsf files, just tell me

Every files is tagged with TagScanner

Feature request ATL.Version

Would it be possible to create an ATL.Version function that returns a text string of the version of the DLL? I know at a minimum i'd like to use it for my about box for credit but it also helps to be sure i'm using the right version in testing.

Short ogg opus file not loaded correctly

The problem

I'm using this library to load mp3 and ogg tracks. With ogg I need support for both vorbis and opus encoding. This seems to work great but short ogg opus tracks doesn't load. I'm using Google Cloud Text-to-Speech and for example the word "Hey" is 811 ms long (according to CSCore.Opus library) but this lib (atldotnet) gives 0 duration and the track isn't initialized. If I get the speech for the text "Hey Google" it works as expected (atldotnet gives a duration and the track loads). If I encode "Hey" with mp3 it works as expected even with atldotnet. Alot of shorter words (hey, of, and, in) does not load with ogg opus and atldotnet.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.12
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10

Code To Reproduce Issue

This code reproduces the problem:

        Track theTrack = new Track("C:\\temp\\hey-opus.ogg");
        var duration = theTrack.DurationMs; // Expected 811, got 0.

The file (hey-opus.ogg) is uploaded here: https://ufile.io/nsy5t80b

Parse Error

The problem

Briefly describe the issue you are experiencing (or the feature you want to see added to ATL).
Tell us what you were trying to do and what happened instead.

Environment

  • ATL version (or git revision) that exhibits the issue:
  • Last ATL version that did not exhibit the issue (if applicable):
  • OS/version used to run ATL

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

Using a file name referenced with URL instead of on local machine.

The problem

I'd like to incorporate ATL as a utility to get the duration of a track.
It works successfully with a file on my local machine (eg C:/temp/MP3/test.mp3) but not with any files hosted on a web server (example using Web Server for Chrome http://192.168.0.7:8888/temp/MP3/test.mp3).
Is there any way to use your library where the path/filename is simply referenced with a URL?

Code Sample

string fileName = "http://192.168.0.7:8888/temp/MP3/test.mp3";
Track theTrack = new Track(fileName);
var trackDuration = theTrack.Duration;

Track.Save() slow in UWP for MP3 files

The problem

Briefly describe the issue you are experiencing (or the feature you want to see added to ATL).
Tell us what you were trying to do and what happened instead.

When I call Track.Save() from my UWP application the process takes about 5 minutes for a 50 minute MP3 file with ID3v2 headers. Testing the same library via a unit test the same operation only takes a second or two. While the file is saving the CPU and RAM are not being pushed but my disk usage is up at 80%.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.11.0
  • Last ATL version that did not exhibit the issue (if applicable): N/A It's been consistent for at least the last few months.
  • OS/version used to run ATL
    Windows 10 1903. Targeting Windows 1809 with Fall Creators update being the minimum version. My audio file code is in a .Net Standard 2.1 library.

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

public class ATLMetadataService : IMetadataService
    {
        private Track Track { get; set; }

        public Metadata Read(Stream fileStream, MimeType mimeType)
        {
            Track = new Track(fileStream, "audio/mp3");
            var useless = Track.EmbeddedPictures;
            return Track.ToMetadata();
        }

        public async Task<bool> Save(Metadata fileData)
        {
            try
            {
                Track.UpdateMetadata(fileData);
                await Task.Run(() => Track.Save());               
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
                return false;
            }
            return true;
        } 
    }

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

ID3 : frames in UTF-8 are not compliant with ID3 v2.3

The problem

ID3v2.3 frames written by atldotnet in UTF-8 are not compliant with ID3v2.3 standard.
As a consequence, unicode character are not correctly displayed in players like foobar2000 or windows file explorer (see screenshot below).

Environment

  • ATL version (or git revision) that exhibits the issue: z440.atl.core.2.5.0.nupkg
  • Last ATL version that did not exhibit the issue (if applicable): ?
  • OS/version used to run ATL : Windows 7 and Powershell 5.1

Details

ID3 v2.3 standard states :
"All Unicode strings use 16-bit unicode 2.0 (ISO/IEC 10646-1:1993, UCS-2). Unicode strings must begin with the Unicode BOM ($FF FE or $FE FF) to identify the byte order.
(...)
Frames that allow different types of text encoding have a text encoding description byte directly after the frame size. If ISO-8859-1 is used this byte should be $00, if Unicode is used it should be $01."

cf. http://id3.org/id3v2.3.0#ID3v2_frame_overview

Code To Reproduce Issue [ Good To Have ]

Import-Module .\net30\ATL.dll

[string] $fileName = "test.mp3"
[ATL.Track] $theTrack = New-Object ATL.Track $fileName
$theTrack.Title = "Titre accentué par ATL"
$theTrack.Save()

utf error foobar

win explorer error

Save m4b with chapters destroys the headers and makes the file unreadable.

The problem

Wrote test data to a smaller sized m4b and it appears to have wiped any meta data and made the file unreadable.

I have sent you a copy of the file i am testing on.

Ok I also just checked the larger file I was testing last night and while it did not crash the app and I am able to read the metadata back the file is also corrupt. This one plays but just a quick humming tone then ends.

Edit --

I did some additional testing and stripped the chapters out of the file i sent you and was able to update/save the file without it crashing but the file is still unplayable (I actually got one test to play but no sound). This appears to be related to having (or had) chapter data since an m4a that has not had chapter data works (except for bug #49).

Environment

Using version 2.16

Details

Logging info:

Upon reading the file in:

Title : Test file
Artist :
Album : Test author
Recording year : 2019
Track number : 0
Disc number : 0
Genre : Audiobook
Comment : this is a comment
Duration (s) : 28504
Bitrate (KBps) : 68
Number of channels : 2
Channels arrangement : Stereo (2/0.0)
Has variable bitrate audio : yes
Has lossless audio : no
Custom field ©too : value = Lavf58.17.101

After clicking save and trying to read load the track info:
d:/test.m4b | moov atom could not be found; aborting read [?=1472 ms]
d:/test.m4b | moov atom could not be found; aborting read [?=69615 ms]
d:/test.m4b | moov atom could not be found; aborting read [?=2 ms]
Title : test
Artist :
Album :
Recording year : 0
Track number : 0
Disc number : 0
Genre :
Comment :
Duration (s) : 0
Bitrate (KBps) : 0
Exception thrown: 'System.NullReferenceException' in M4BCreator.exe
theTrack.<Field at offset 0x0000005C> was null.

The line it is erroring on is:

System.Console.WriteLine("Number of channels : " + theTrack.ChannelsArrangement.NbChannels);

The file is no longer playable.

I am using your example code

    private void btnSave_Click(object sender, EventArgs e)
    {
        // Adapt this to whatever your file path needs to be
        string fileName = "d:/test.m4b";

        // Load audio file information into memory
        Track theTrack = new Track(fileName);

        // Modify metadata
        theTrack.Artist = "Hey ho";
        theTrack.Composer = "Oscar Wilde";


        // Save modifications on the disc
        theTrack.Save();
    }

Can't resolve the reference

The problem

I'm trying to use the nuget package in a .net standard 2.0 project in the core layer for an ios/android app. And I've got an error at compile time.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.3.0
  • Last ATL version that did not exhibit the issue (if applicable):
  • OS/version used to run ATL: Visual Studio for mac

Detail

At compile time I get the following error:
MTOUCH : error MT2101: Can't resolve the reference 'ATL.Track', referenced from the method 'System.Void MH.Klets.Core.Services.MediaPlayerService::ParseMetaData(System.String)' in 'ATL, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null'. Error processing method: 'System.Void MH.Klets.Core.Services.MediaPlayerService::ParseMetaData(System.String)' in assembly: 'MH.Klets.Core.dll' Failed to resolve ATL.Track at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x001f0] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Tuning.cs:99
at Xamarin.Bundler.Target.LinkAssemblies (System.Collections.Generic.List1[Mono.Cecil.AssemblyDefinition]& assemblies, System.String output_dir, System.Collections.Generic.IEnumerable1[T] sharedCodeTargets) [0x00256] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Target.cs:500
at Xamarin.Bundler.Target.ManagedLink () [0x00714] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Target.cs:646
at Xamarin.Bundler.Target.ProcessAssemblies () [0x000c2] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Target.cs:836
at Xamarin.Bundler.Application.ProcessAssemblies () [0x0002f] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Application.cs:1393
at Xamarin.Bundler.Application.BuildManaged () [0x00001] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Application.cs:817
at Xamarin.Bundler.Application+<>c.b__138_1 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Application.cs:765
at System.Collections.Generic.List1[T].ForEach (System.Action1[T] action) [0x00024] in :0
at Xamarin.Bundler.Application.BuildAll () [0x00050] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/Application.cs:765
at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00448] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/mtouch.cs:1390
at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/tools/mtouch/mtouch.cs:918
The command exited with code 1.`

Reading ID3v2.4 throwing System.IndexOutOfRangeException

I am unable to read files in with preexisting ID3v2.4 tagging.

I tried using the first code example just to make sure it wasn't my code and the problem still appears.

I'm using ATL 2.8, Windows 10.
I used the exact first code example you provided I've only changed the filename.
I also attached a screenshot and the file.

![image](https://user-images.githubusercontent.com/25760153/56940773-703f6e80-6ade-11e9-8070-439e3bd3a584.png
Edit : File removed
)

Selecting Multiple files

Not an Issue more of a desire,

I’m looking for an example that shows how to read in multiple files or a whole directory. I’ve looked through the example test files but I haven’t seen anything that looks like it would work.

I tried using version 2.7 and 2.8 and trying to load the data into Lists then into arrays but I just keep getting duplicates of the last file selected.

Saving of .pls Playlist.

The problem

If you save a playlist in ".pls" format atl can't Load it back.
There is a problem is saving code.
I already Fixed the issue by removing line 53 :- w.WriteLine(""); from PLSIO.cs

Environment

  • ATL 2.9
  • Last ATL version that did not exhibit the issue (if applicable):
  • Windows 10 1809, Visual Studio 2019, WPF dot.net 4.6.2

Details

Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll
at System.String.Substring(Int32 startIndex, Int32 length)
at ATL.Playlist.IO.PLSIO.getFiles(FileStream fs, IList`1 result) in atldotnet-2.9\ATL\Playlist\IO\PLSIO.cs:line 23
at ATL.Playlist.PlaylistIO.getFiles() in atldotnet-2.9\ATL\Playlist\PlaylistIO.cs:line 45

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

private void LoadButton_Click(object sender, RoutedEventArgs e)
{
var openFile = new OpenFileDialog() { };
if (openFile.ShowDialog() != true) return;
IPlaylistIO theReader = PlaylistIOFactory.GetInstance().GetPlaylistIO(openFile.FileName);
foreach (string s in theReader.FilePaths)
{
listbox.Items.Add(s);
}
}
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
IPlaylistIO pls = PlaylistIOFactory.GetInstance().GetPlaylistIO("G:/abc.pls");
// Writing file paths
IList pathsToWrite = new List();
foreach (var item in listbox..Items)
{
pathsToWrite.Add(item.ToString());
}
pls.FilePaths = pathsToWrite;
}

Support for writing playlists?

I've only found references to PlaylistReader with a glance. Does it support creating playlists (m3u...) from a list of tracks?

ATL does not yet handle the case where Vorbis setup header spans across two OGG pages

The problem

I've tried to update Comment tag, part of OpusTags metadata in my sample opus audio file. The file is not updated with the new info, and after call to Save(), the content is replaced with previous data. See code to reproduce below for exact steps.

Environment

Latest ATL version as of now (2.11.0), reproduced in netcoreapp2.2 app, running in following environment:

 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows

Details

Upon enabling logging:

ATL does not yet handle the case where Vorbis setup header spans across two OGG pages

Which is likely caused because of embedded cover art into the file. I'd appreciate if you could consider adding this functionality in the near future.

Code To Reproduce Issue [ Good To Have ]

Track track = new Track("C:\\Path\\To\\sample.opus");
track.Comment = "Test";
track.Save();

I'm attaching file sample to let you reproduce the issue more easily.

sample.zip

Thank you in advance!

Is there a way to show save progress?

I have started testing saving of metadata to my audio book files and at first thought it was failing because I was seeing some mdat atom not found errors in the log but it turns out it was just taking a long time to save. Is there a way to display out the metadata save progress?

Parse Exception

The problem

It's always throw exception when ATL is try to load some audio file.other audio files is fine.

Environment

2.4.0 at Nuget ,2.3.0 same

Win10 1709
.Net framework 4.6.1
vs2017

Details


problem audio file

Code To Reproduce Issue [ Good To Have ]

Code

ATL chapter implementation not displaying in Apple Podcasts and other podcast grabbers

The problem

While ATL does an amazing job of writing chapters in the correct CTOC frame in ID3v2 as per the Chapter Frame Addendum, now that the Apple Podcasts app has Chapter support, it's a good test environment for ATL Chapter implementation; however, contrary to other podcasts that use a commercial chapter implementation, ATL Chapter implementation doesn't seem to show at all in Apple Podcasts, and only partially shows in other podcast grabbers like Overcast.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.7
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

After inspection of the CTOC frame under Additional Fields for both implementations, the only notable difference is the lack of the ACKNOWLEDGE ACK (u0006) character, and the lack of the TIT2 sub-frame, which includes the START OF HEADING SOH (u0001) code, the UTF-16 BYTE ORDER MARK BOM (ÿþ)

commercial implementation:

{[CTOC, toc
CTOC
toc\0\u0003\u0006chp0\0chp1\0chp2\0chp3\0chp4\0chp5\0TIT2\0\0\0%\0\0\u0001ÿþT\0a\0b\0l\0e\0 \0o\0f\0 \0C\0o\0n\0t\0e\0n\0t\0s

ATL implementation:

{[CTOC, toc
CTOC
toc\0\u0003\u0003chp0\0chp1\0chp2

Note that for the commercial implementation after the UTF-16 BOM the string "Table of Contents" is concatenated

Steps To Reproduce Issue (images attached)

  1. In Apple Podcasts iOS search the Ruminate podcast
  2. Once located, play episode 13 "Crumpets On Your Tea Towel", this specific episode contains a commercial chapters implementation
  3. Scroll down and notice that under the Chapters section in the iOS app, there is a clickable Chapter list. Once clicked the podcast will be skipped to the beginning of each chapter.
  4. In Apple Podcasts iOS, search the El Chilanyorker podcast
  5. Once located, play any episode, all episodes in this specific podcast contain an ATL Chapter implementation

Result:

  1. Scroll down and notice that there is no Chapters section in the iOS app, ergo no chapter list, and no clickable items.

Expected:

  • The ATL Chapter implementation podcast should show the Chapter sections, a Chapter list, and chapter clickable items in the Apple Podcasts App

Note:

In the Overcast podcast grabber the same behavior happens, with a little exception: even when a Chapter section isn't rendered, the Chapter titles do appear; however, there's no way to navigate between them.

Thanks so much!

Unable to Update Popularity Field

The problem

Writes to popularity field are not preserved after saving the tag. Hoping I'm not just doing something stupid here.

Environment

  • ATL version: 3.0.0
  • Last ATL version: NA
  • OS/version used to run ATL: Windows 10 Home version 1903, .Net Core 2.2, VS2019

Code To Reproduce Issue [ Good To Have ]

    static void Main(string[] args)
    {

        // Adapt this to whatever your file path needs to be
        string fileName = "test1.mp3";

        // Load audio file information into memory
        ATL.Track theTrack = new ATL.Track(fileName);

        // Modify metadata
        Console.WriteLine("Popularity pre update: " + theTrack.Popularity);
        theTrack.Popularity = 5;
        Console.WriteLine("Popularity post update: " + theTrack.Popularity);
        theTrack.Save();
        Console.WriteLine("Popularity post save: " + theTrack.Popularity);

    }

Popularity pre update: 0
Popularity post update: 5
Popularity post save: 0

TIT2 CTOC subframe is missing from the Chapters implementation

The problem

There seems to be no support for, or at least no way to explicitly add, the optional TIT2 CTOC subframe for ATL's Chapter implementation.

Environment

  • ATL version (or git revision) that exhibits the issue: 2.7
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

By default, the TIT2 CTOC subframe is not present when persisting a file with at least one chapter using ATL:

{[CTOC, toc
CTOC
toc\0\u0003\u0003chp0\0chp1\0chp2

There should be a way for adding the TIT2 CTOC frame

[ENHANCEMENT] New Setting for saving the file's ID3v2 tags in ID3v2.3

The problem

By Design, ID3v2 tags are saved in v2.4. While this is the expected behaviour, and even issue #16 briefly ignited the discussion, my only take on having support for v2.3 would be for cosmetic purposes.

  1. In Windows (see environment below) whenever ATL updates an audio file like MP3 after embedding an image via metadata, the resulting MP3 file's metadata is saved in ID3v2.4. The icon for this file fails to show the image in Windows Explorer view; however, when explicitly converted to ID3v2.3 (using SW like Mp3tag) the resulting updated file does show the embedded image in all Windows Explorer views.

  2. Currently, ATL Chapter implementation fails to show chapters in at least two podcast grabber apps: Apple Podcast, and Overcast. Even when the ID3v2 Chapter Frame Addendum explicitly supports both v2.3 and v2.4, a commercial software for Chapter support for the Mac, only supports v2.3. ¿Maybe podcast grabbers don't like v2.4 yet? Until further investigation I cannot make the case for Chapter support and ID2v2.3, but I wanted to at least put it on the table

Environment

  • ATL version (or git revision) that exhibits the issue: 2.7
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

It would be super nice to have a setting like:

public static bool ID3v2_alwaysSaveUsingID3v2.3 = false;

explicitly false by default, and only when set to true will the resulting updated ID3v2 be saved in ID3v2.3, otherwise ID3v2.4 like it is today by design.

Code To Reproduce Issue

ATL.Track theTrack = new ATL.Track("C:\podcast.mp3");
string sCoverPath = "C:\picture.jpg";
            
ATL.PictureInfo newPicture = new ATL.PictureInfo(Commons.ImageFormat.Jpeg, ATL.PictureInfo.PIC_TYPE.CD);
newPicture.PictureData = System.IO.File.ReadAllBytes(sCoverPath);

// check if there's an existing cover image
if (!(theTrack.EmbeddedPictures.Count == 0)){
	theTrack.EmbeddedPictures.RemoveAt(0);
}

theTrack.EmbeddedPictures.Add(newPicture);
theTrack.Save();

Unable to read lyrics from m4a

I am using this library to read the lyrics from mp3 and m4a files. I have used MusicBee to embed lyrics into my m4a files and when using this library to retrieve the lyrics it is showing no lyrics available. It will display the lyrics of the mp3 file fine, but not the m4a files.

  • ATL version 2.16.0 (Using nuget package):
  • Windows 10 Pro
  • Using nuget package through LINQPad.

Code I am using:

var track = new Track(PathToFile);  
var lyrics = track.Lyrics.UnsynchronizedLyrics;

Track.Lyrics is empty for both Synchronized and UnsynchronizedLyrics.

[QUESTION] How to add a picture to thisChapter.Picture?

The problem

Before I go and and change my implementation, I was wondering if the following code would theoretically work for adding a picture to a specific chapter:

using ATL.AudioData;

AudioDataManager theFile = new AudioDataManager(AudioDataIOFactory.GetInstance().GetFromPath(fileName));

TagData theTag = new TagData();
theTag.Chapters = new System.Collections.Generic.List<ChapterInfo>();

PictureInfo newPicture = new PictureInfo(Commons.ImageFormat.Gif, PictureInfo.PIC_TYPE.CD);
newPicture.PictureData = System.IO.File.ReadAllBytes("E:/temp/_Images/pic1.gif");

ChapterInfo ch = new ChapterInfo();
ch.StartTime = 123;
ch.StartOffset = 456;
ch.EndTime = 789;
ch.EndOffset = 101112;
ch.UniqueID = "";
ch.Title = "aaa";
ch.Subtitle = "bbb";
ch.Url = "ccc\0ddd";
ch.Picture = newPicture;
theTag.Chapters.Add(ch);

Environment

  • ATL version (or git revision) that exhibits the issue: 2.8 (main branch)
  • Last ATL version that did not exhibit the issue (if applicable): N/A
  • OS/version used to run ATL: Windows 10 x64, v1803, build 17134.648

Details

The few instances I've find where a picture is used on specific chapters do not appear under Picture in the Chapter Array, and hence my question :(

M4A and M4B artist info incorrectly saved

The problem

using your sample code for loading and saving if you save the exact code as shown in the sample the file appears to save correctly and you can even reload the file to see the new artist info shown by ATL but no other program (windows, mp3tag, media player, itunes) is able to find and use that tag.

If you load the file in mediainfo it shows it under a tag called "art" whereas in an mp3 its under performer.

General
Complete name                            : D:\test.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /mp42/isom)
File size                                : 68.8 MiB
Duration                                 : 1 h 31 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 106 kb/s
Album                                    : Fake album starts here and is longer than the original one
Album/Performer                          : Christina Sorg
Track name                               : test
Composer                                 : Oscar Wilde
ContentType                              : Music
Encoded date                             : UTC 2035-05-27 17:11:54
Tagged date                              : UTC 2020-01-18 03:24:40
Cover                                    : Yes
art                                      : Hey ho

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 31 min
Bit rate mode                            : Variable
Bit rate                                 : 105 kb/s
Maximum bit rate                         : 116 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 68.3 MiB (99%)
Language                                 : English
Encoded date                             : UTC 2035-05-27 17:11:54
Tagged date                              : UTC 2035-05-27 17:11:54

That same file with a correctly working artist in an m4a shows the tag should be performer

General
Complete name                            : D:\test - Copy.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /mp42/isom)
File size                                : 68.8 MiB
Duration                                 : 1 h 31 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 106 kb/s
Album                                    : How to Budget A Guide for Beginners
Album/Performer                          : Christina Sorg
Performer                                : Christina Sorg
ContentType                              : Music
Encoded date                             : UTC 2035-05-27 17:11:54
Tagged date                              : UTC 2020-01-18 03:24:40
Cover                                    : Yes

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 31 min
Bit rate mode                            : Variable
Bit rate                                 : 105 kb/s
Maximum bit rate                         : 116 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 68.3 MiB (99%)
Language                                 : English
Encoded date                             : UTC 2035-05-27 17:11:54
Tagged date                              : UTC 2035-05-27 17:11:54

Environment

2.16 on Win10 1809

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.